Skip to content

define_analysis_scheme

define_analysis_scheme(
    domain_name: DomainName,
    analysis_scheme: AnalysisScheme,
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> DefineAnalysisSchemeResponse

Configures an analysis scheme that can be applied to a text or text-array field to define language-specific text processing options. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.

Raises:

Source code in docs_src/capo_cloudsearch/_services/cloud_search.py
def define_analysis_scheme(
    self,
    domain_name: "capo_cloudsearch.types.domain_name.DomainName",
    analysis_scheme: "capo_cloudsearch.types.analysis_scheme.AnalysisScheme",
    *,
    config_overrides: Optional[CloudSearchClientConfig] = None,
) -> "capo_cloudsearch.types.define_analysis_scheme_response.DefineAnalysisSchemeResponse":
    """<p>Configures an analysis scheme that can be applied to a <code>text</code> or <code>text-array</code> field to define language-specific text processing options. For more information, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-analysis-schemes.html" target="_blank">Configuring Analysis Schemes</a> in the <i>Amazon CloudSearch Developer Guide</i>.</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.invalid_type_exception.InvalidTypeException: <p>The request was rejected because it specified an invalid type definition.</p>
        capo_cloudsearch.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because a resource limit has already been met.</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.define_analysis_scheme_request.DefineAnalysisSchemeRequest]",
    ) -> OperationResponse[
        "capo_cloudsearch.types.define_analysis_scheme_response.DefineAnalysisSchemeResponse"
    ]:
        import capo_cloudsearch._operations.a9_search_cloud_config_service2013.define_analysis_scheme

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DefineAnalysisScheme")
    )
    input_: capo_cloudsearch.types.define_analysis_scheme_request.DefineAnalysisSchemeRequest = {
        "domain_name": domain_name,
        "analysis_scheme": analysis_scheme,
    }

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