SearchIndexingBufferedSender Class

  • java.lang.Object
    • com.azure.search.documents.SearchIndexingBufferedSender

Type Parameters

T

The type of the document handled by this buffered indexing sender.

public final class SearchIndexingBufferedSender

This class provides a buffered sender that contains operations for conveniently indexing documents to an Azure Search index.

Method Summary

Modifier and Type Method and Description
void addActions(Collection actions)

Adds document index actions to the batch.

void addActions(Collection actions, Duration timeout, RequestOptions requestOptions)

Adds document index actions to the batch.

void addDeleteActions(Collection documents)

Adds delete document actions to the batch.

void addDeleteActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds delete document actions to the batch.

void addMergeActions(Collection documents)

Adds merge document actions to the batch.

void addMergeActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds merge document actions to the batch.

void addMergeOrUploadActions(Collection documents)

Adds merge or upload document actions to the batch.

void addMergeOrUploadActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds merge or upload document actions to the batch.

void addUploadActions(Collection documents)

Adds upload document actions to the batch.

void addUploadActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds upload document actions to the batch.

void close()

Closes the buffered sender, any documents remaining in the batch will be sent to the Search index for indexing.

void close(Duration timeout, RequestOptions requestOptions)

Closes the buffered, any documents remaining in the batch yet to be sent to the Search index for indexing.

void flush()

Sends the current batch of documents to be indexed.

void flush(Duration timeout, RequestOptions requestOptions)

Sends the current batch of documents to be indexed.

Collection<IndexAction> getActions()

Gets the list of IndexAction in the batch that are ready to be indexed.

Methods inherited from java.lang.Object

Method Details

addActions

public void addActions(Collection actions)

Adds document index actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

actions - Index actions.

addActions

public void addActions(Collection actions, Duration timeout, RequestOptions requestOptions)

Adds document index actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

actions - Index actions.
timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

addDeleteActions

public void addDeleteActions(Collection documents)

Adds delete document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be deleted.

addDeleteActions

public void addDeleteActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds delete document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be deleted.
timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

addMergeActions

public void addMergeActions(Collection documents)

Adds merge document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be merged.

addMergeActions

public void addMergeActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds merge document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be merged.
timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

addMergeOrUploadActions

public void addMergeOrUploadActions(Collection documents)

Adds merge or upload document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be merged or uploaded.

addMergeOrUploadActions

public void addMergeOrUploadActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds merge or upload document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be merged or uploaded.
timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

addUploadActions

public void addUploadActions(Collection documents)

Adds upload document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be uploaded.

addUploadActions

public void addUploadActions(Collection documents, Duration timeout, RequestOptions requestOptions)

Adds upload document actions to the batch.

If the client is enabled for automatic batch sending, adding documents may trigger the batch to be sent for indexing.

Parameters:

documents - Documents to be uploaded.
timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

close

public void close()

Closes the buffered sender, any documents remaining in the batch will be sent to the Search index for indexing.

Once the buffered sender has been closed any attempts to add documents or flush it will cause an IllegalStateException to be thrown.

close

public void close(Duration timeout, RequestOptions requestOptions)

Closes the buffered, any documents remaining in the batch yet to be sent to the Search index for indexing.

Once the buffered sender has been closed any attempts to add documents or flush it will cause an IllegalStateException to be thrown.

Parameters:

timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

flush

public void flush()

Sends the current batch of documents to be indexed.

flush

public void flush(Duration timeout, RequestOptions requestOptions)

Sends the current batch of documents to be indexed.

Parameters:

timeout - Duration before the operation times out.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

getActions

public Collection getActions()

Gets the list of IndexAction in the batch that are ready to be indexed.

Returns:

The list of IndexAction in the batch that are ready to be indexed.

Applies to