Skip to main content

query_suggestions_block_lists

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

Overview

Namequery_suggestions_block_lists
TypeResource
Idaws.kendra.query_suggestions_block_lists

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The Unix timestamp when a block list for query suggestions was created.
descriptionstringThe description for the block list. (pattern: <code>^\P{C}*$</code>)
error_messagestringThe error message containing details if there are issues processing the block list. (pattern: <code>^\P{C}*$</code>)
file_size_bytesinteger (int64)The current size of the block list text file in S3.
idstringThe identifier of the block list. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>)
index_idstringThe identifier of the index for the block list. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>)
item_countintegerThe current number of valid, non-empty words or phrases in the block list text file.
namestringThe name of the block list. (pattern: <code>^[a-zA-Z0-9](-[a-zA-Z0-9])</code>)
role_arnstringThe 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_pathobjectInformation required to find a specific file in an Amazon S3 bucket.
statusstringThe 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_atstring (date-time)The Unix timestamp when a block list for query suggestions was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_query_suggestions_block_listselectregionGets 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_listinsertregion, IndexId, SourceS3Path, RoleArnCreates 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_listupdateregion, IndexIdUpdates 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_listdeleteregionDeletes 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_listsexecregion, IndexIdLists 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.

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

SELECT examples

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

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
;

UPDATE examples

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

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

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 }}
}'
;