thesaurus
Creates, updates, deletes, gets or lists a thesaurus resource.
Overview
| Name | thesaurus |
| Type | Resource |
| Id | aws.kendra.thesaurus |
Fields
The following fields are returned by SELECT queries:
- describe_thesaurus
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The Unix timestamp when the thesaurus was created. |
description | string | The thesaurus description. (pattern: <code>^\P{C}*$</code>) |
error_message | string | When the Status field value is FAILED, the ErrorMessage field provides more information. (pattern: <code>^\P{C}*$</code>) |
file_size_bytes | integer (int64) | The size of the thesaurus file in bytes. |
id | string | The identifier of the thesaurus. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>) |
index_id | string | The identifier of the index for the thesaurus. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>) |
name | string | The thesaurus name. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>) |
role_arn | string | An 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_path | object | Information required to find a specific file in an Amazon S3 bucket. |
status | string | The 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_count | integer (int64) | The number of synonym rules in the thesaurus file. |
term_count | integer (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_at | string (date-time) | The Unix timestamp when the thesaurus was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_thesaurus | select | region | Gets information about an Amazon Kendra thesaurus. | |
create_thesaurus | insert | region, IndexId, RoleArn, SourceS3Path | 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. | |
update_thesaurus | update | region, IndexId | Updates a thesaurus for an index. | |
delete_thesaurus | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_thesaurus
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
- create_thesaurus
- Manifest
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
;
# Description fields are for documentation purposes
- name: thesaurus
props:
- name: region
value: "{{ region }}"
description: Required parameter for the thesaurus resource.
- name: IndexId
value: "{{ IndexId }}"
description: |
The identifier of the index for the thesaurus.
- name: Name
value: "{{ Name }}"
description: |
A name for the thesaurus.
- name: Description
value: "{{ Description }}"
description: |
A description for the thesaurus.
- name: RoleArn
value: "{{ RoleArn }}"
description: |
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.
- name: Tags
description: |
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: _ . : / = + - @.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: SourceS3Path
description: |
Information required to find a specific file in an Amazon S3 bucket.
value:
Bucket: "{{ Bucket }}"
Key: "{{ Key }}"
- name: ClientToken
value: "{{ ClientToken }}"
description: |
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.
UPDATE examples
- update_thesaurus
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
- delete_thesaurus
Deletes an Amazon Kendra thesaurus.
DELETE FROM aws.kendra.thesaurus
WHERE region = '{{ region }}' --required
;