IndexDocumentsBatch class

Class used to perform batch operations with multiple documents to the index.

Constructors

IndexDocumentsBatch<TModel>(IndexDocumentsAction<TModel>[])

Properties

actions

The set of actions taken in this batch.

Methods

delete(keyof TModel, string[])

Delete a set of documents.

delete(TModel[])

Delete a set of documents.

merge(TModel[])

Update a set of documents in the index. For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents

mergeOrUpload(TModel[])

Update a set of documents in the index or uploads them if they don't exist. For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents

upload(TModel[])

Upload an array of documents to the index.

Constructor Details

IndexDocumentsBatch<TModel>(IndexDocumentsAction<TModel>[])

new IndexDocumentsBatch(actions?: IndexDocumentsAction<TModel>[])

Parameters

actions

IndexDocumentsAction<TModel>[]

Property Details

actions

The set of actions taken in this batch.

actions: IndexDocumentsAction<TModel>[]

Property Value

Method Details

delete(keyof TModel, string[])

Delete a set of documents.

function delete(keyName: keyof TModel, keyValues: string[])

Parameters

keyName

keyof TModel

The name of their primary key in the index.

keyValues

string[]

The primary key values of documents to delete.

delete(TModel[])

Delete a set of documents.

function delete(documents: TModel[])

Parameters

documents

TModel[]

Documents to be deleted.

merge(TModel[])

Update a set of documents in the index. For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents

function merge(documents: TModel[])

Parameters

documents

TModel[]

The updated documents.

mergeOrUpload(TModel[])

Update a set of documents in the index or uploads them if they don't exist. For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents

function mergeOrUpload(documents: TModel[])

Parameters

documents

TModel[]

The new/updated documents.

upload(TModel[])

Upload an array of documents to the index.

function upload(documents: TModel[])

Parameters

documents

TModel[]

The documents to upload.