SearchClient.IndexDocumentsAsync<T> Method
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.
Sends a batch of upload, merge, and/or delete actions to the search index. Add, Update or Delete Documents
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult>> IndexDocumentsAsync<T>(Azure.Search.Documents.Models.IndexDocumentsBatch<T> batch, Azure.Search.Documents.IndexDocumentsOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member IndexDocumentsAsync : Azure.Search.Documents.Models.IndexDocumentsBatch<'T> * Azure.Search.Documents.IndexDocumentsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult>>
override this.IndexDocumentsAsync : Azure.Search.Documents.Models.IndexDocumentsBatch<'T> * Azure.Search.Documents.IndexDocumentsOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult>>
Public Overridable Function IndexDocumentsAsync(Of T) (batch As IndexDocumentsBatch(Of T), Optional options As IndexDocumentsOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of IndexDocumentsResult))
- T
The .NET type that maps to the index schema. Instances of this type can be retrieved as documents from the index.
- batch
- IndexDocumentsBatch<T>
The batch of document index actions.
- options
- IndexDocumentsOptions
Options that allow specifying document indexing behavior.
- cancellationToken
- CancellationToken
Optional CancellationToken to propagate notifications that the operation should be canceled.
Response containing the status of operations for all actions in the batch of actions.
Thrown when a failure is returned by the Search Service.
The generic overloads of the IndexDocuments and IndexDocumentsAsync methods support mapping of search field types to .NET types via the type parameter T. See GetDocumentAsync<T>(String, GetDocumentOptions, CancellationToken) for more details on the type mapping.
By default, an exception will only be thrown if the entire request fails. Individual failures are described in the Results collection. You can set ThrowOnAnyError if you want individual RequestFailedExceptions wrapped into an AggregateException that's thrown on partial failure.
Product | Versies |
---|---|
Azure SDK for .NET | Latest, Preview |
Azure SDK for .NET-feedback
Azure SDK for .NET is een open source project. Selecteer een koppeling om feedback te geven: