create_query_suggestions_block_list

kendra.Client.create_query_suggestions_block_list(**kwargs)

Creates a block list to exlcude certain queries from suggestions.

Any query that contains words or phrases specified in the block list is blocked or filtered out from being shown as a suggestion.

You need to provide the file location of your block list text file in your S3 bucket. In your text file, enter each block word or phrase on a separate line.

For information on the current quota limits for block lists, see Quotas for Amazon Kendra.

CreateQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region.

For an example of creating a block list for query suggestions using the Python SDK, see Query suggestions block list.

See also: AWS API Documentation

Request Syntax

response = client.create_query_suggestions_block_list(
    IndexId='string',
    Name='string',
    Description='string',
    SourceS3Path={
        'Bucket': 'string',
        'Key': 'string'
    },
    ClientToken='string',
    RoleArn='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters
  • IndexId (string) --

    [REQUIRED]

    The identifier of the index you want to create a query suggestions block list for.

  • Name (string) --

    [REQUIRED]

    A user friendly name for the block list.

    For example, the block list named 'offensive-words' includes all offensive words that could appear in user queries and need to be blocked from suggestions.

  • Description (string) --

    A user-friendly description for the block list.

    For example, the description "List of all offensive words that can appear in user queries and need to be blocked from suggestions."

  • SourceS3Path (dict) --

    [REQUIRED]

    The S3 path to your block list text file in your S3 bucket.

    Each block word or phrase should be on a separate line in a text file.

    For information on the current quota limits for block lists, see Quotas for Amazon Kendra.

    • Bucket (string) -- [REQUIRED]

      The name of the S3 bucket that contains the file.

    • Key (string) -- [REQUIRED]

      The name of the file.

  • ClientToken (string) --

    A token that you provide to identify the request to create a query suggestions block list.

    This field is autopopulated if not provided.

  • RoleArn (string) --

    [REQUIRED]

    The IAM (Identity and Access Management) role used by Amazon Kendra to access the block list text file in your S3 bucket.

    You need permissions to the role ARN (Amazon Web Services Resource Name). The role needs S3 read permissions to your file in S3 and needs to give STS (Security Token Service) assume role permissions to Amazon Kendra.

  • Tags (list) --

    A tag that you can assign to a block list that categorizes the block list.

    • (dict) --

      A list of key/value pairs that identify an index, FAQ, or data source. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

      • Key (string) -- [REQUIRED]

        The key for the tag. Keys are not case sensitive and must be unique for the index, FAQ, or data source.

      • Value (string) -- [REQUIRED]

        The value associated with the tag. The value may be an empty string but it can't be null.

Return type

dict

Returns

Response Syntax

{
    'Id': 'string'
}

Response Structure

  • (dict) --

    • Id (string) --

      The identifier of the created block list.

Exceptions

  • kendra.Client.exceptions.ValidationException
  • kendra.Client.exceptions.ResourceNotFoundException
  • kendra.Client.exceptions.ThrottlingException
  • kendra.Client.exceptions.AccessDeniedException
  • kendra.Client.exceptions.ServiceQuotaExceededException
  • kendra.Client.exceptions.ConflictException
  • kendra.Client.exceptions.InternalServerException