:doc:`kendra <../../kendra>` / Client / create_query_suggestions_block_list

***********************************
create_query_suggestions_block_list
***********************************



.. py:method:: 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 <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html>`__.

   

  ``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 <https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html#query-suggestions-blocklist>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/kendra-2019-02-03/CreateQuerySuggestionsBlockList>`_  


  **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'
            },
        ]
    )
    
  :type IndexId: string
  :param IndexId: **[REQUIRED]** 

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

    

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    A name for the block list.

     

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

    

  
  :type Description: string
  :param Description: 

    A 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."

    

  
  :type SourceS3Path: dict
  :param SourceS3Path: **[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 <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html>`__.

    

  
    - **Bucket** *(string) --* **[REQUIRED]** 

      The name of the S3 bucket that contains the file.

      

    
    - **Key** *(string) --* **[REQUIRED]** 

      The name of the file.

      

    
  
  :type ClientToken: string
  :param ClientToken: 

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

    This field is autopopulated if not provided.

  
  :type RoleArn: string
  :param RoleArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the block list text file. For more information, see `IAM access roles for Amazon Kendra <https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html>`__.

    

  
  :type Tags: list
  :param Tags: 

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

    

  
    - *(dict) --* 

      A key-value pair that identifies or categorizes an index, FAQ, data source, or other resource. TA tag key and value 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, data source, or other resource.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

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

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Id': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Id** *(string) --* 

        The identifier of the block list.

        
  
  **Exceptions**
  
  *   :py:class:`kendra.Client.exceptions.ValidationException`

  
  *   :py:class:`kendra.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`kendra.Client.exceptions.ThrottlingException`

  
  *   :py:class:`kendra.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`kendra.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`kendra.Client.exceptions.ConflictException`

  
  *   :py:class:`kendra.Client.exceptions.InternalServerException`

  