Skip to main content

thesaurus

Creates, updates, deletes, gets or lists a thesaurus resource.

Overview

Namethesaurus
TypeResource
Idaws.kendra.thesaurus

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The Unix timestamp when the thesaurus was created.
descriptionstringThe thesaurus description. (pattern: <code>^\P{C}*$</code>)
error_messagestringWhen the Status field value is FAILED, the ErrorMessage field provides more information. (pattern: <code>^\P{C}*$</code>)
file_size_bytesinteger (int64)The size of the thesaurus file in bytes.
idstringThe identifier of the thesaurus. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>)
index_idstringThe identifier of the index for the thesaurus. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>)
namestringThe thesaurus name. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>)
role_arnstringAn IAM role that gives Amazon Kendra permissions to access thesaurus file specified in SourceS3Path. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
source_s3_pathobjectInformation required to find a specific file in an Amazon S3 bucket.
statusstringThe current status of the thesaurus. When the value is ACTIVE, queries are able to use the thesaurus. If the Status field value is FAILED, the ErrorMessage field provides more information. If the status is ACTIVE_BUT_UPDATE_FAILED, it means that Amazon Kendra could not ingest the new thesaurus file. The old thesaurus file is still active. (CREATING, ACTIVE, DELETING, UPDATING, ACTIVE_BUT_UPDATE_FAILED, FAILED)
synonym_rule_countinteger (int64)The number of synonym rules in the thesaurus file.
term_countinteger (int64)The number of unique terms in the thesaurus file. For example, the synonyms a,b,c and a=>d, the term count would be 4.
updated_atstring (date-time)The Unix timestamp when the thesaurus was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_thesaurusselectregionGets information about an Amazon Kendra thesaurus.
create_thesaurusinsertregion, IndexId, RoleArn, SourceS3PathCreates 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.
update_thesaurusupdateregion, IndexIdUpdates a thesaurus for an index.
delete_thesaurusdeleteregionDeletes an Amazon Kendra thesaurus.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Gets information about an Amazon Kendra thesaurus.

SELECT
created_at,
description,
error_message,
file_size_bytes,
id,
index_id,
name,
role_arn,
source_s3_path,
status,
synonym_rule_count,
term_count,
updated_at
FROM aws.kendra.thesaurus
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.kendra.thesaurus (
IndexId,
Name,
Description,
RoleArn,
Tags,
SourceS3Path,
ClientToken,
region
)
SELECT
'{{ IndexId }}' /* required */,
'{{ Name }}',
'{{ Description }}',
'{{ RoleArn }}' /* required */,
'{{ Tags }}',
'{{ SourceS3Path }}' /* required */,
'{{ ClientToken }}',
'{{ region }}'
RETURNING
id
;

UPDATE examples

Updates a thesaurus for an index.

UPDATE aws.kendra.thesaurus
SET
Id = '{{ Id }}',
Name = '{{ Name }}',
IndexId = '{{ IndexId }}',
Description = '{{ Description }}',
RoleArn = '{{ RoleArn }}',
SourceS3Path = '{{ SourceS3Path }}'
WHERE
region = '{{ region }}' --required
AND IndexId = '{{ IndexId }}' --required;

DELETE examples

Deletes an Amazon Kendra thesaurus.

DELETE FROM aws.kendra.thesaurus
WHERE region = '{{ region }}' --required
;