SearchClient.MergeDocuments<T> 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.
Merge documents to the index as a batch.
public virtual Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult> MergeDocuments<T> (System.Collections.Generic.IEnumerable<T> documents, Azure.Search.Documents.IndexDocumentsOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member MergeDocuments : seq<'T> * Azure.Search.Documents.IndexDocumentsOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult>
override this.MergeDocuments : seq<'T> * Azure.Search.Documents.IndexDocumentsOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Search.Documents.Models.IndexDocumentsResult>
Public Overridable Function MergeDocuments(Of T) (documents As IEnumerable(Of T), Optional options As IndexDocumentsOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IndexDocumentsResult)
Type Parameters
- T
The .NET type that maps to the index schema. Instances of this type can be retrieved as documents from the index.
Parameters
- documents
- IEnumerable<T>
The documents to merge.
- options
- IndexDocumentsOptions
Options that allow specifying document indexing behavior.
- cancellationToken
- CancellationToken
Optional CancellationToken to propagate notifications that the operation should be canceled.
Returns
Response containing the status of operations for all actions in the batch of actions.
Exceptions
Thrown when a failure is returned by the Search Service.
Remarks
The generic overloads of the MergeDocuments and MergeDocumentsAsync 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 exceptions thrown on partial failure.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應