SearchIndexClient.UpdateKnowledgeSourceFileAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| UpdateKnowledgeSourceFileAsync(String, String, UpdateKnowledgeSourceFileRequest, CancellationToken) |
Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes. |
| UpdateKnowledgeSourceFileAsync(String, String, RequestContent, String, RequestContext) |
[Protocol Method] Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
|
UpdateKnowledgeSourceFileAsync(String, String, UpdateKnowledgeSourceFileRequest, CancellationToken)
- Source:
- SearchIndexClient.cs
Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>> UpdateKnowledgeSourceFileAsync(string fileId, string sourceName, Azure.Search.Documents.Indexes.Models.UpdateKnowledgeSourceFileRequest body, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateKnowledgeSourceFileAsync : string * string * Azure.Search.Documents.Indexes.Models.UpdateKnowledgeSourceFileRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
override this.UpdateKnowledgeSourceFileAsync : string * string * Azure.Search.Documents.Indexes.Models.UpdateKnowledgeSourceFileRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
Public Overridable Function UpdateKnowledgeSourceFileAsync (fileId As String, sourceName As String, body As UpdateKnowledgeSourceFileRequest, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KnowledgeSourceFile))
Parameters
- fileId
- String
The unique identifier of the file to update.
- sourceName
- String
The name of the knowledge source.
The multipart/form-data body containing the metadata and content parts.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
fileId, sourceName or body is null.
fileId or sourceName is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Applies to
UpdateKnowledgeSourceFileAsync(String, String, RequestContent, String, RequestContext)
- Source:
- SearchIndexClient.cs
[Protocol Method] Updates an existing file in a File knowledge source in place, replacing its indexed content. Uses multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> UpdateKnowledgeSourceFileAsync(string fileId, string sourceName, Azure.Core.RequestContent content, string contentType, Azure.RequestContext context = default);
abstract member UpdateKnowledgeSourceFileAsync : string * string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UpdateKnowledgeSourceFileAsync : string * string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UpdateKnowledgeSourceFileAsync (fileId As String, sourceName As String, content As RequestContent, contentType As String, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- fileId
- String
The unique identifier of the file to update.
- sourceName
- String
The name of the knowledge source.
- content
- RequestContent
The content to send as the body of the request.
- contentType
- String
The contentType to use which has the multipart/form-data boundary.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
fileId, sourceName, content or contentType is null.
fileId, sourceName or contentType is an empty string, and was expected to be non-empty.
Service returned a non-success status code.