SearchIndexingBufferedSender Class

A buffered sender for document indexing actions.

Inheritance
azure.search.documents._search_indexing_buffered_sender_base.SearchIndexingBufferedSenderBase
SearchIndexingBufferedSender
azure.search.documents._headers_mixin.HeadersMixin
SearchIndexingBufferedSender

Constructor

SearchIndexingBufferedSender(endpoint: str, index_name: str, credential: AzureKeyCredential, **kwargs: Any)

Parameters

endpoint
str
Required

The URL endpoint of an Azure search service

index_name
str
Required

The name of the index to connect to

credential
AzureKeyCredential
Required

A credential to authorize search client requests

auto_flush_interval
int

how many max seconds if between 2 flushes. This only takes effect when auto_flush is on. Default to 60 seconds.

initial_batch_action_count
int

The initial number of actions to group into a batch when tuning the behavior of the sender. The default value is 512.

max_retries_per_action
int

The number of times to retry a failed document. The default value is 3.

on_new
callable

If it is set, the client will call corresponding methods when there is a new IndexAction added.

on_progress
callable

If it is set, the client will call corresponding methods when there is a IndexAction succeeds.

on_error
callable

If it is set, the client will call corresponding methods when there is a IndexAction fails.

on_remove
callable

If it is set, the client will call corresponding methods when there is a IndexAction removed from the queue (succeeds or fails).

api_version
str

The Search API version to use for requests.

Methods

close

Close the SearchClient session.

delete_documents

Queue delete documents actions :param documents: A list of documents to delete. :type documents: List[dict]

flush

Flush the batch. :param int timeout: time out setting. Default is 86400s (one day) :return: True if there are errors. Else False :rtype: bool :raises ~azure.core.exceptions.ServiceResponseTimeoutError:

index_documents

Specify a document operations to perform as a batch.

:raises RequestEntityTooLargeError

merge_documents

Queue merge documents actions :param documents: A list of documents to merge. :type documents: List[dict]

merge_or_upload_documents

Queue merge documents or upload documents actions :param documents: A list of documents to merge or upload. :type documents: List[dict]

upload_documents

Queue upload documents actions. :param documents: A list of documents to upload. :type documents: List[dict]

close

Close the SearchClient session.

async close(**kwargs) -> None

delete_documents

Queue delete documents actions :param documents: A list of documents to delete. :type documents: List[dict]

async delete_documents()

flush

Flush the batch. :param int timeout: time out setting. Default is 86400s (one day) :return: True if there are errors. Else False :rtype: bool :raises ~azure.core.exceptions.ServiceResponseTimeoutError:

async flush()

index_documents

Specify a document operations to perform as a batch.

:raises RequestEntityTooLargeError

async index_documents(batch: IndexDocumentsBatch, **kwargs: Any) -> List[IndexingResult]

Parameters

batch
IndexDocumentsBatch
Required

A batch of document operations to perform.

Return type

<xref:List>[IndexingResult]

merge_documents

Queue merge documents actions :param documents: A list of documents to merge. :type documents: List[dict]

async merge_documents()

merge_or_upload_documents

Queue merge documents or upload documents actions :param documents: A list of documents to merge or upload. :type documents: List[dict]

async merge_or_upload_documents()

upload_documents

Queue upload documents actions. :param documents: A list of documents to upload. :type documents: List[dict]

async upload_documents()

Attributes

actions

The list of currently index actions in queue to index. :rtype: List[IndexAction]