DocumentOperationsExtensions.Index Method

 

Applies To: Microsoft Azure

Namespace:   Microsoft.Azure.Search
Assembly:  Microsoft.Azure.Search (in Microsoft.Azure.Search.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static Index(IDocumentOperations, IndexBatch)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index. https://msdn.microsoft.com/library/azure/dn798935.aspx

System_CAPS_pubmethodSystem_CAPS_static Index<T>(IDocumentOperations, IndexBatch<T>)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index. https://msdn.microsoft.com/library/azure/dn798935.aspx

See Also

DocumentOperationsExtensions Class
Microsoft.Azure.Search Namespace

Return to top

DocumentOperationsExtensions.Index Method (IDocumentOperations, IndexBatch)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index. https://msdn.microsoft.com/library/azure/dn798935.aspx

Syntax

public static DocumentIndexResponse Index(
    this IDocumentOperations operations,
    IndexBatch batch
)
public:
[ExtensionAttribute]
static DocumentIndexResponse^ Index(
    IDocumentOperations^ operations,
    IndexBatch^ batch
)
static member Index : 
        operations:IDocumentOperations *
        batch:IndexBatch -> DocumentIndexResponse
<ExtensionAttribute>
Public Shared Function Index (
    operations As IDocumentOperations,
    batch As IndexBatch
) As DocumentIndexResponse

Parameters

Return Value

Type: Microsoft.Azure.Search.Models.DocumentIndexResponse

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

Exceptions

Exception Condition
IndexBatchException

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

Return to top

DocumentOperationsExtensions.Index<T> Method (IDocumentOperations, IndexBatch<T>)

Sends a batch of upload, merge, and/or delete actions to the Azure Search index. https://msdn.microsoft.com/library/azure/dn798935.aspx

Syntax

public static DocumentIndexResponse Index<T>(
    this IDocumentOperations operations,
    IndexBatch<T> batch
)
where T : class
public:
generic<typename T>
where T : ref class
[ExtensionAttribute]
static DocumentIndexResponse^ Index(
    IDocumentOperations^ operations,
    IndexBatch<T>^ batch
)
static member Index<'T when 'T : not struct> : 
        operations:IDocumentOperations *
        batch:IndexBatch<'T> -> DocumentIndexResponse
<ExtensionAttribute>
Public Shared Function Index(Of T As Class) (
    operations As IDocumentOperations,
    batch As IndexBatch(Of T)
) As DocumentIndexResponse

Parameters

Return Value

Type: Microsoft.Azure.Search.Models.DocumentIndexResponse

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

Type Parameters

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

Exceptions

Exception Condition
IndexBatchException

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 IndexResponse 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 GetAsync<T> for more details on the type mapping.

Return to top