Bagikan melalui


IndexAction.MergeOrUpload<T>(T) Method

Definition

Creates a new IndexAction for uploading a document to the index, or merging it into an existing document if it already exists in the index.

public static Microsoft.Azure.Search.Models.IndexAction<T> MergeOrUpload<T> (T document);
static member MergeOrUpload : 'T -> Microsoft.Azure.Search.Models.IndexAction<'T>
Public Shared Function MergeOrUpload(Of T) (document As T) As IndexAction(Of T)

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

document
T

The document to merge or upload.

Returns

A new IndexAction.

Remarks

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