create_query_suggestions_block_list
async
¶
create_query_suggestions_block_list(
index_id: IndexId,
name: QuerySuggestionsBlockListName,
source_s3_path: S3Path,
role_arn: RoleArn,
*,
config_overrides: Optional[AsynckendraClientConfig] = None,
description: Optional[Description] = None,
client_token: Optional[ClientTokenName] = None,
tags: Optional[TagList] = None,
) -> CreateQuerySuggestionsBlockListResponse
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.
Parameters:
-
index_id(IndexId) –The identifier of the index you want to create a query suggestions block list for.
-
name(QuerySuggestionsBlockListName) –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.
-
description(Optional[Description], default:None) –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."
-
source_s3_path(S3Path) –The S3 path to your block list text file in your S3 bucket.
Each block word or phrase should be on a separate line in a text file.
For information on the current quota limits for block lists, see Quotas for Amazon Kendra.
-
client_token(Optional[ClientTokenName], default:None) –A token that you provide to identify the request to create a query suggestions block list.
-
role_arn(RoleArn) –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.
-
tags(Optional[TagList], default:None) –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: _ . : / = + - @.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.
-
ConflictException–A conflict occurred with the request. Please fix any inconsistences with your resources and try again.
-
InternalServerException–An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact Support for help.
-
ResourceNotFoundException–The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.
-
ServiceQuotaExceededException– -
ThrottlingException–The request was denied due to request throttling. Please reduce the number of requests and try again.
-
ValidationException–The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_kendra/_services/async_kendra.py
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 | |