DocumentsOperationsExtensions.Index DocumentsOperationsExtensions.Index Method

Definition

Overloads

Index(IDocumentsOperations, IndexBatch, SearchRequestOptions) Index(IDocumentsOperations, IndexBatch, SearchRequestOptions)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index.

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

Sends a batch of upload, merge, and/or delete actions to the Azure Search index.

Index(IDocumentsOperations, IndexBatch, SearchRequestOptions) Index(IDocumentsOperations, IndexBatch, SearchRequestOptions)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index.

public static Microsoft.Azure.Search.Models.DocumentIndexResult Index (this Microsoft.Azure.Search.IDocumentsOperations operations, Microsoft.Azure.Search.Models.IndexBatch batch, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = null);
static member Index : Microsoft.Azure.Search.IDocumentsOperations * Microsoft.Azure.Search.Models.IndexBatch * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.DocumentIndexResult

Parameters

operations
IDocumentsOperations IDocumentsOperations

The operations group for this extension method.

batch
IndexBatch IndexBatch

The batch of index actions.

searchRequestOptions
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.

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

Sends a batch of upload, merge, and/or delete actions to the Azure Search index.

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 = null) where T : class;
static member Index : Microsoft.Azure.Search.IDocumentsOperations * Microsoft.Azure.Search.Models.IndexBatch<'T (requires 'T : null)> * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.DocumentIndexResult (requires 'T : null)

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 IDocumentsOperations

The operations group for this extension method.

batch
IndexBatch<T> IndexBatch<T>

The batch of index actions.

searchRequestOptions
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 Azure 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