kendra / Client / create_thesaurus
create_thesaurus#
- 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.
See also: AWS API Documentation
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' )
- Parameters:
IndexId (string) –
[REQUIRED]
The identifier of the index for the thesaurus.
Name (string) –
[REQUIRED]
A name for the thesaurus.
Description (string) – A description for the thesaurus.
RoleArn (string) –
[REQUIRED]
An IAM role that gives Amazon Kendra permissions to access thesaurus file specified in
SourceS3Path
.Tags (list) –
A list of key-value pairs that identify the thesaurus. You can use the tags to identify and organize your resources and to control access to resources.
(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.
SourceS3Path (dict) –
[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.
ClientToken (string) –
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.
- Return type:
dict
- Returns:
Response Syntax
{ 'Id': 'string' }
Response Structure
(dict) –
Id (string) –
The identifier of the thesaurus.
Exceptions
kendra.Client.exceptions.ValidationException
kendra.Client.exceptions.ConflictException
kendra.Client.exceptions.ResourceNotFoundException
kendra.Client.exceptions.ThrottlingException
kendra.Client.exceptions.ServiceQuotaExceededException
kendra.Client.exceptions.AccessDeniedException
kendra.Client.exceptions.InternalServerException