Skip to content

index_documents

index_documents(
    domain_name: DomainName,
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> IndexDocumentsResponse

Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is RequiresIndexDocuments.

Raises:

Source code in docs_src/capo_cloudsearch/_services/cloud_search.py
def index_documents(
    self,
    domain_name: "capo_cloudsearch.types.domain_name.DomainName",
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> "capo_cloudsearch.types.index_documents_response.IndexDocumentsResponse":
    """<p>Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose <a>OptionStatus</a> is <code>RequiresIndexDocuments</code>.</p>

    Raises:
        capo_cloudsearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_cloudsearch.errors.internal_exception.InternalException: <p>An internal error occurred while processing the request. If this problem persists, report an issue from the <a href="http://status.aws.amazon.com/" target="_blank">Service Health Dashboard</a>.</p>
        capo_cloudsearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because it attempted to reference a resource that does not exist.</p>
        capo_cloudsearch.errors.validation_exception.ValidationException: <p>The request was rejected because it has invalid parameters.</p>
        capo_cloudsearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudsearch.types.index_documents_request.IndexDocumentsRequest]",
    ) -> OperationResponse[
        "capo_cloudsearch.types.index_documents_response.IndexDocumentsResponse"
    ]:
        import capo_cloudsearch._operations.a9_search_cloud_config_service2013.index_documents

        output, http_response = (
            capo_cloudsearch._operations.a9_search_cloud_config_service2013.index_documents.index_documents(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("IndexDocuments")
    )
    input_: capo_cloudsearch.types.index_documents_request.IndexDocumentsRequest = {
        "domain_name": domain_name
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output