DocumentsOperationsExtensions.Index Method

Definition

Overloads

Index(IDocumentsOperations, IndexBatch<Document>, SearchRequestOptions)

Sends a batch of upload, merge, and/or delete actions to the search index. https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents

Index<T>(IDocumentsOperations, IndexBatch<T>, SearchRequestOptions)

Sends a batch of upload, merge, and/or delete actions to the search index. https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents

Index(IDocumentsOperations, IndexBatch<Document>, SearchRequestOptions)

Source:
DocumentsOperationsExtensions.cs

Sends a batch of upload, merge, and/or delete actions to the search index. https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents

public static Microsoft.Azure.Search.Models.DocumentIndexResult Index (this Microsoft.Azure.Search.IDocumentsOperations operations, Microsoft.Azure.Search.Models.IndexBatch<Microsoft.Azure.Search.Models.Document> batch, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default);
static member Index : Microsoft.Azure.Search.IDocumentsOperations * Microsoft.Azure.Search.Models.IndexBatch<Microsoft.Azure.Search.Models.Document> * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.DocumentIndexResult
<Extension()>
Public Function Index (operations As IDocumentsOperations, batch As IndexBatch(Of Document), Optional searchRequestOptions As SearchRequestOptions = Nothing) As DocumentIndexResult

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

batch
IndexBatch<Document>

The batch of index actions.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

Returns

Response containing the status of operations for all actions in the batch.

Exceptions

Thrown when some of the indexing actions failed, but other actions succeeded and modified the state of the index. This can happen when the Search Service is under heavy indexing load. It is important to explicitly catch this exception and check its IndexResult property. This property reports the status of each indexing action in the batch, making it possible to determine the state of the index after a partial failure.

Remarks

The non-generic overloads of the Index, IndexAsync, and IndexWithHttpMessagesAsync methods make a best-effort attempt to map JSON types in the response payload to .NET types. See GetWithHttpMessagesAsync(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken) for more information.

Applies to

Index<T>(IDocumentsOperations, IndexBatch<T>, SearchRequestOptions)

Source:
DocumentsOperationsExtensions.cs

Sends a batch of upload, merge, and/or delete actions to the search index. https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents

public static Microsoft.Azure.Search.Models.DocumentIndexResult Index<T> (this Microsoft.Azure.Search.IDocumentsOperations operations, Microsoft.Azure.Search.Models.IndexBatch<T> batch, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default);
static member Index : Microsoft.Azure.Search.IDocumentsOperations * Microsoft.Azure.Search.Models.IndexBatch<'T> * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.DocumentIndexResult
<Extension()>
Public Function Index(Of T) (operations As IDocumentsOperations, batch As IndexBatch(Of T), Optional searchRequestOptions As SearchRequestOptions = Nothing) As DocumentIndexResult

Type Parameters

T

The CLR type that maps to the index schema. Instances of this type can be stored as documents in the index.

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

batch
IndexBatch<T>

The batch of index actions.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

Returns

Response containing the status of operations for all actions in the batch.

Exceptions

Thrown when some of the indexing actions failed, but other actions succeeded and modified the state of the index. This can happen when the Search Service is under heavy indexing load. It is important to explicitly catch this exception and check its IndexResult property. This property reports the status of each indexing action in the batch, making it possible to determine the state of the index after a partial failure.

Remarks

The generic overloads of the Index and IndexAsync methods support mapping of search field types to .NET types via the type parameter T. See GetWithHttpMessagesAsync<T>(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken) for more details on the type mapping.

Applies to