IndexBatch.MergeOrUpload<T>(IEnumerable<T>) Method


Creates a new IndexBatch for uploading documents to the index, or merging them into existing documents for those that already exist in the index.

public static Microsoft.Azure.Search.Models.IndexBatch<T> MergeOrUpload<T> (System.Collections.Generic.IEnumerable<T> documents);
static member MergeOrUpload : seq<'T> -> Microsoft.Azure.Search.Models.IndexBatch<'T>
Public Shared Function MergeOrUpload(Of T) (documents As IEnumerable(Of T)) As IndexBatch(Of T)

Type Parameters


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



The documents to merge or upload.



A new IndexBatch.


If type T contains non-nullable value-typed properties, these properties may not merge correctly. If you do not set such a property, it will automatically take its default value (for example, 0 for int or false for bool), which will override the value of the property currently stored in the index, even if this was not your intent. For this reason, it is strongly recommended that you always declare value-typed properties to be nullable in type T.

The above does not apply if you are using Document as type T.

Applies to