query_suggestions_block_lists
Creates, updates, deletes, gets or lists a query_suggestions_block_lists resource.
Overview
| Name | query_suggestions_block_lists |
| Type | Resource |
| Id | aws.kendra.query_suggestions_block_lists |
Fields
The following fields are returned by SELECT queries:
- describe_query_suggestions_block_list
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The Unix timestamp when a block list for query suggestions was created. |
description | string | The description for the block list. (pattern: <code>^\P{C}*$</code>) |
error_message | string | The error message containing details if there are issues processing the block list. (pattern: <code>^\P{C}*$</code>) |
file_size_bytes | integer (int64) | The current size of the block list text file in S3. |
id | string | The identifier of the block list. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>) |
index_id | string | The identifier of the index for the block list. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>) |
item_count | integer | The current number of valid, non-empty words or phrases in the block list text file. |
name | string | The name of the block list. (pattern: <code>^[a-zA-Z0-9](-[a-zA-Z0-9])</code>) |
role_arn | string | The IAM (Identity and Access Management) role used by Amazon Kendra to access the block list text file in S3. The role needs S3 read permissions to your file in S3 and needs to give STS (Security Token Service) assume role permissions to Amazon Kendra. (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 block list. When the value is ACTIVE, the block list is ready for use. (ACTIVE, CREATING, DELETING, UPDATING, ACTIVE_BUT_UPDATE_FAILED, FAILED) |
updated_at | string (date-time) | The Unix timestamp when a block list for query suggestions was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_query_suggestions_block_list | select | region | Gets information about a block list used for query suggestions for an index. This is used to check the current settings that are applied to a block list. DescribeQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region. | |
create_query_suggestions_block_list | insert | region, IndexId, SourceS3Path, RoleArn | 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. 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. | |
update_query_suggestions_block_list | update | region, IndexId | Updates a block list used for query suggestions for an index. Updates to a block list might not take effect right away. Amazon Kendra needs to refresh the entire suggestions list to apply any updates to the block list. Other changes not related to the block list apply immediately. If a block list is updating, then you need to wait for the first update to finish before submitting another update. Amazon Kendra supports partial updates, so you only need to provide the fields you want to update. UpdateQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region. | |
delete_query_suggestions_block_list | delete | region | Deletes a block list used for query suggestions for an index. A deleted block list might not take effect right away. Amazon Kendra needs to refresh the entire suggestions list to add back the queries that were previously blocked. DeleteQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region. | |
list_query_suggestions_block_lists | exec | region, IndexId | Lists the block lists used for query suggestions for an index. For information on the current quota limits for block lists, see Quotas for Amazon Kendra. ListQuerySuggestionsBlockLists is currently not supported in the Amazon Web Services GovCloud (US-West) region. |
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_query_suggestions_block_list
Gets information about a block list used for query suggestions for an index. This is used to check the current settings that are applied to a block list. DescribeQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region.
SELECT
created_at,
description,
error_message,
file_size_bytes,
id,
index_id,
item_count,
name,
role_arn,
source_s3_path,
status,
updated_at
FROM aws.kendra.query_suggestions_block_lists
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_query_suggestions_block_list
- Manifest
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. 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.
INSERT INTO aws.kendra.query_suggestions_block_lists (
IndexId,
Name,
Description,
SourceS3Path,
ClientToken,
RoleArn,
Tags,
region
)
SELECT
'{{ IndexId }}' /* required */,
'{{ Name }}',
'{{ Description }}',
'{{ SourceS3Path }}' /* required */,
'{{ ClientToken }}',
'{{ RoleArn }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
id
;
# Description fields are for documentation purposes
- name: query_suggestions_block_lists
props:
- name: region
value: "{{ region }}"
description: Required parameter for the query_suggestions_block_lists resource.
- name: IndexId
value: "{{ IndexId }}"
description: |
The identifier of the index you want to create a query suggestions block list for.
- name: Name
value: "{{ Name }}"
description: |
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.
- name: Description
value: "{{ Description }}"
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."
- 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 query suggestions block list.
- name: RoleArn
value: "{{ RoleArn }}"
description: |
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.
- name: Tags
description: |
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: _ . : / = + - @.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_query_suggestions_block_list
Updates a block list used for query suggestions for an index. Updates to a block list might not take effect right away. Amazon Kendra needs to refresh the entire suggestions list to apply any updates to the block list. Other changes not related to the block list apply immediately. If a block list is updating, then you need to wait for the first update to finish before submitting another update. Amazon Kendra supports partial updates, so you only need to provide the fields you want to update. UpdateQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region.
UPDATE aws.kendra.query_suggestions_block_lists
SET
IndexId = '{{ IndexId }}',
Id = '{{ Id }}',
Name = '{{ Name }}',
Description = '{{ Description }}',
SourceS3Path = '{{ SourceS3Path }}',
RoleArn = '{{ RoleArn }}'
WHERE
region = '{{ region }}' --required
AND IndexId = '{{ IndexId }}' --required;
DELETE examples
- delete_query_suggestions_block_list
Deletes a block list used for query suggestions for an index. A deleted block list might not take effect right away. Amazon Kendra needs to refresh the entire suggestions list to add back the queries that were previously blocked. DeleteQuerySuggestionsBlockList is currently not supported in the Amazon Web Services GovCloud (US-West) region.
DELETE FROM aws.kendra.query_suggestions_block_lists
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- list_query_suggestions_block_lists
Lists the block lists used for query suggestions for an index. For information on the current quota limits for block lists, see Quotas for Amazon Kendra. ListQuerySuggestionsBlockLists is currently not supported in the Amazon Web Services GovCloud (US-West) region.
EXEC aws.kendra.query_suggestions_block_lists.list_query_suggestions_block_lists
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"NextToken": "{{ NextToken }}",
"MaxResults": {{ MaxResults }}
}'
;