SearchIndexingBufferedSender Class
A buffered sender for document indexing actions.
Constructor
SearchIndexingBufferedSender(endpoint: str, index_name: str, credential: AzureKeyCredential | AsyncTokenCredential, **kwargs: Any)
Parameters
| Name | Description |
|---|---|
|
endpoint
Required
|
The URL endpoint of an Azure search service |
|
index_name
Required
|
The name of the index to connect to |
|
credential
Required
|
A credential to authorize search client requests |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
auto_flush_interval
|
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
|
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
|
The number of times to retry a failed document. The default value is 3. |
|
on_new
|
If it is set, the client will call corresponding methods when there is a new IndexAction added. |
|
on_progress
|
If it is set, the client will call corresponding methods when there is a IndexAction succeeds. |
|
on_error
|
If it is set, the client will call corresponding methods when there is a IndexAction fails. |
|
on_remove
|
If it is set, the client will call corresponding methods when there is a IndexAction removed from the queue (succeeds or fails). |
|
api_version
|
The Search API version to use for requests. |
|
audience
|
sets the Audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. If audience is not provided, the public cloud audience will be assumed. |
Methods
| close |
Close the session. :return: None :rtype: None |
| 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 ~azure.search.documents.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 session. :return: None :rtype: None
async close(**kwargs: Any) -> None
delete_documents
Queue delete documents actions :param documents: A list of documents to delete. :type documents: list[Dict]
async delete_documents(documents: List[Dict], **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
documents
Required
|
|
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(timeout: int = 86400, **kwargs) -> bool
Parameters
| Name | Description |
|---|---|
|
timeout
|
Default value: 86400
|
index_documents
Specify a document operations to perform as a batch.
:raises ~azure.search.documents.RequestEntityTooLargeError
async index_documents(batch: IndexDocumentsBatch, **kwargs: Any) -> List[IndexingResult]
Parameters
| Name | Description |
|---|---|
|
batch
Required
|
A batch of document operations to perform. |
Returns
| Type | Description |
|---|---|
|
Indexing result for each action in the batch. |
merge_documents
Queue merge documents actions :param documents: A list of documents to merge. :type documents: list[dict]
async merge_documents(documents: List[Dict], **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
documents
Required
|
|
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(documents: List[Dict], **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
documents
Required
|
|
upload_documents
Queue upload documents actions. :param documents: A list of documents to upload. :type documents: list[dict]
async upload_documents(documents: List[Dict], **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
documents
Required
|
|
Attributes
actions
The list of currently index actions in queue to index. :return: The list of currently index actions in queue to index. :rtype: list[IndexAction]