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

****************
create_thesaurus
****************



.. py:method:: kendra.Client.create_thesaurus(**kwargs)

  

  Creates a thesaurus for an index. The thesaurus contains a list of synonyms in Solr format.

   

  For an example of adding a thesaurus file to an index, see `Adding custom synonyms to an index <https://docs.aws.amazon.com/kendra/latest/dg/index-synonyms-adding-thesaurus-file.html>`__.

  

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


  **Request Syntax**
  ::

    response = client.create_thesaurus(
        IndexId='string',
        Name='string',
        Description='string',
        RoleArn='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        SourceS3Path={
            'Bucket': 'string',
            'Key': 'string'
        },
        ClientToken='string'
    )
    
  :type IndexId: string
  :param IndexId: **[REQUIRED]** 

    The identifier of the index for the thesaurus.

    

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

    A name for the thesaurus.

    

  
  :type Description: string
  :param Description: 

    A description for the thesaurus.

    

  
  :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 thesaurus 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 thesaurus. You can also use tags to help control access to the thesaurus. 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.

        

      
    

  :type SourceS3Path: dict
  :param SourceS3Path: **[REQUIRED]** 

    The path to the thesaurus file in S3.

    

  
    - **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 thesaurus. Multiple calls to the ``CreateThesaurus`` API with the same client token will create only one thesaurus.

    This field is autopopulated if not provided.

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

    
    ::

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

    

    - *(dict) --* 
      

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

        The identifier of the thesaurus.

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

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

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

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

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

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

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

  