indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | aws.kendra.indexes |
Fields
The following fields are returned by SELECT queries:
- describe_index
| Name | Datatype | Description |
|---|---|---|
capacity_units | object | For Enterprise Edition indexes, you can choose to use additional capacity to meet the needs of your application. This contains the capacity units used for the index. A query or document storage capacity of zero indicates that the index is using the default capacity. For more information on the default capacity for an index and adjusting this, see Adjusting capacity. |
created_at | string (date-time) | The Unix timestamp when the index was created. |
description | string | The description for the index. (pattern: <code>^\P{C}*$</code>) |
document_metadata_configurations | array | Configuration information for document metadata or fields. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document. |
edition | string | The Amazon Kendra edition used for the index. You decide the edition when you create the index. (DEVELOPER_EDITION, ENTERPRISE_EDITION, GEN_AI_ENTERPRISE_EDITION) |
error_message | string | When the Status field value is FAILED, the ErrorMessage field contains a message that explains why. (pattern: <code>^\P{C}*$</code>) |
id | string | The identifier of the index. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>) |
index_statistics | object | Provides information about the number of FAQ questions and answers and the number of text documents indexed. |
name | string | The name of the index. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>) |
role_arn | string | The Amazon Resource Name (ARN) of the IAM role that gives Amazon Kendra permission to write to your Amazon CloudWatch logs. (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>) |
server_side_encryption_configuration | object | The identifier of the KMS customer master key (CMK) that is used to encrypt your data. Amazon Kendra doesn't support asymmetric CMKs. |
status | string | The current status of the index. When the value is ACTIVE, the index is ready for use. If the Status field value is FAILED, the ErrorMessage field contains a message that explains why. (CREATING, ACTIVE, DELETING, FAILED, UPDATING, SYSTEM_UPDATING) |
updated_at | string (date-time) | The Unix timestamp when the index was last updated. |
user_context_policy | string | The user context policy for the Amazon Kendra index. (ATTRIBUTE_FILTER, USER_TOKEN) |
user_group_resolution_configuration | object | Whether you have enabled IAM Identity Center identity source for your users and groups. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents. |
user_token_configurations | array | The user token configuration for the Amazon Kendra index. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_index | select | region | Gets information about an Amazon Kendra index. | |
create_index | insert | region, RoleArn | Creates an Amazon Kendra index. Index creation is an asynchronous API. To determine if index creation has completed, check the Status field returned from a call to DescribeIndex. The Status field is set to ACTIVE when the index is ready to use. Once the index is active, you can index your documents using the BatchPutDocument API or using one of the supported data sources. For an example of creating an index and data source using the Python SDK, see Getting started with Python SDK. For an example of creating an index and data source using the Java SDK, see Getting started with Java SDK. | |
associate_personas_to_entities | update | region, IndexId, Personas | Defines the specific permissions of users or groups in your IAM Identity Center identity source with access to your Amazon Kendra experience. You can create an Amazon Kendra experience such as a search application. For more information on creating a search application experience, see Building a search experience with no code. | |
disassociate_personas_from_entities | update | region, IndexId, EntityIds | Removes the specific permissions of users or groups in your IAM Identity Center identity source with access to your Amazon Kendra experience. You can create an Amazon Kendra experience such as a search application. For more information on creating a search application experience, see Building a search experience with no code. | |
update_index | update | region | Updates an Amazon Kendra index. | |
delete_index | delete | region | Deletes an Amazon Kendra index. An exception is not thrown if the index is already being deleted. While the index is being deleted, the Status field returned by a call to the DescribeIndex API is set to DELETING. | |
batch_delete_document | exec | region, IndexId, DocumentIdList | Removes one or more documents from an index. The documents must have been added with the BatchPutDocument API. The documents are deleted asynchronously. You can see the progress of the deletion by using Amazon Web Services CloudWatch. Any error messages related to the processing of the batch are sent to your Amazon Web Services CloudWatch log. You can also use the BatchGetDocumentStatus API to monitor the progress of deleting your documents. Deleting documents from an index using BatchDeleteDocument could take up to an hour or more, depending on the number of documents you want to delete. | |
batch_put_document | exec | region, IndexId, Documents | Adds one or more documents to an index. The BatchPutDocument API enables you to ingest inline documents or a set of documents stored in an Amazon S3 bucket. Use this API to ingest your text and unstructured text into an index, add custom attributes to the documents, and to attach an access control list to the documents added to the index. The documents are indexed asynchronously. You can see the progress of the batch using Amazon Web Services CloudWatch. Any error messages related to processing the batch are sent to your Amazon Web Services CloudWatch log. You can also use the BatchGetDocumentStatus API to monitor the progress of indexing your documents. For an example of ingesting inline documents using Python and Java SDKs, see Adding files directly to an index. | |
query | exec | region, IndexId | Searches an index given an input query. If you are working with large language models (LLMs) or implementing retrieval augmented generation (RAG) systems, you can use Amazon Kendra's Retrieve API, which can return longer semantically relevant passages. We recommend using the Retrieve API instead of filing a service limit increase to increase the Query API document excerpt length. You can configure boosting or relevance tuning at the query level to override boosting at the index level, filter based on document fields/attributes and faceted search, and filter based on the user or their group access to documents. You can also include certain fields in the response that might provide useful additional information. A query response contains three types of results. Relevant suggested answers. The answers can be either a text excerpt or table excerpt. The answer can be highlighted in the excerpt. Matching FAQs or questions-answer from your FAQ file. Relevant documents. This result type includes an excerpt of the document with the document title. The searched terms can be highlighted in the excerpt. You can specify that the query return only one type of result using the QueryResultTypeFilter parameter. Each query returns the 100 most relevant results. If you filter result type to only question-answers, a maximum of four results are returned. If you filter result type to only answers, a maximum of three results are returned. If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error. | |
retrieve | exec | region, IndexId, QueryText | Retrieves relevant passages or text excerpts given an input query. This API is similar to the Query API. However, by default, the Query API only returns excerpt passages of up to 100 token words. With the Retrieve API, you can retrieve longer passages of up to 200 token words and up to 100 semantically relevant passages. This doesn't include question-answer or FAQ type responses from your index. The passages are text excerpts that can be semantically extracted from multiple documents and multiple parts of the same document. If in extreme cases your documents produce zero passages using the Retrieve API, you can alternatively use the Query API and its types of responses. You can also do the following: Override boosting at the index level Filter based on document fields or attributes Filter based on the user or their group access to documents View the confidence score bucket for a retrieved passage result. The confidence bucket provides a relative ranking that indicates how confident Amazon Kendra is that the response is relevant to the query. Confidence score buckets are currently available only for English. You can also include certain fields in the response that might provide useful additional information. The Retrieve API shares the number of query capacity units that you set for your index. For more information on what's included in a single capacity unit and the default base capacity for an index, see Adjusting capacity. If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error. | |
submit_feedback | exec | region, IndexId, QueryId | Enables you to provide feedback to Amazon Kendra to improve the performance of your index. SubmitFeedback 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_index
Gets information about an Amazon Kendra index.
SELECT
capacity_units,
created_at,
description,
document_metadata_configurations,
edition,
error_message,
id,
index_statistics,
name,
role_arn,
server_side_encryption_configuration,
status,
updated_at,
user_context_policy,
user_group_resolution_configuration,
user_token_configurations
FROM aws.kendra.indexes
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_index
- Manifest
Creates an Amazon Kendra index. Index creation is an asynchronous API. To determine if index creation has completed, check the Status field returned from a call to DescribeIndex. The Status field is set to ACTIVE when the index is ready to use. Once the index is active, you can index your documents using the BatchPutDocument API or using one of the supported data sources. For an example of creating an index and data source using the Python SDK, see Getting started with Python SDK. For an example of creating an index and data source using the Java SDK, see Getting started with Java SDK.
INSERT INTO aws.kendra.indexes (
Name,
Edition,
RoleArn,
ServerSideEncryptionConfiguration,
Description,
ClientToken,
Tags,
UserTokenConfigurations,
UserContextPolicy,
UserGroupResolutionConfiguration,
region
)
SELECT
'{{ Name }}',
'{{ Edition }}',
'{{ RoleArn }}' /* required */,
'{{ ServerSideEncryptionConfiguration }}',
'{{ Description }}',
'{{ ClientToken }}',
'{{ Tags }}',
'{{ UserTokenConfigurations }}',
'{{ UserContextPolicy }}',
'{{ UserGroupResolutionConfiguration }}',
'{{ region }}'
RETURNING
id
;
# Description fields are for documentation purposes
- name: indexes
props:
- name: region
value: "{{ region }}"
description: Required parameter for the indexes resource.
- name: Name
value: "{{ Name }}"
description: |
A name for the index.
- name: Edition
value: "{{ Edition }}"
description: |
The Amazon Kendra edition to use for the index. Choose DEVELOPER_EDITION for indexes intended for development, testing, or proof of concept. Use ENTERPRISE_EDITION for production. Use GEN_AI_ENTERPRISE_EDITION for creating generative AI applications. Once you set the edition for an index, it can't be changed. The Edition parameter is optional. If you don't supply a value, the default is ENTERPRISE_EDITION. For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see Quotas.
valid_values: ['DEVELOPER_EDITION', 'ENTERPRISE_EDITION', 'GEN_AI_ENTERPRISE_EDITION']
- name: RoleArn
value: "{{ RoleArn }}"
description: |
The Amazon Resource Name (ARN) of an IAM role with permission to access your Amazon CloudWatch logs and metrics. For more information, see IAM access roles for Amazon Kendra.
- name: ServerSideEncryptionConfiguration
description: |
The identifier of the KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.
value:
KmsKeyId: "{{ KmsKeyId }}"
- name: Description
value: "{{ Description }}"
description: |
A description for the index.
- name: ClientToken
value: "{{ ClientToken }}"
description: |
A token that you provide to identify the request to create an index. Multiple calls to the CreateIndex API with the same client token will create only one index.
- name: Tags
description: |
A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: UserTokenConfigurations
description: |
The user token configuration. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use UserTokenConfigurations to configure user context policy, Amazon Kendra returns a ValidationException error.
value:
- JwtTokenTypeConfiguration:
KeyLocation: "{{ KeyLocation }}"
URL: "{{ URL }}"
SecretManagerArn: "{{ SecretManagerArn }}"
UserNameAttributeField: "{{ UserNameAttributeField }}"
GroupAttributeField: "{{ GroupAttributeField }}"
Issuer: "{{ Issuer }}"
ClaimRegex: "{{ ClaimRegex }}"
JsonTokenTypeConfiguration:
UserNameAttributeField: "{{ UserNameAttributeField }}"
GroupAttributeField: "{{ GroupAttributeField }}"
- name: UserContextPolicy
value: "{{ UserContextPolicy }}"
description: |
The user context policy. If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error. ATTRIBUTE_FILTER All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of _user_id and _group_ids or you can provide user and group information in UserContext. USER_TOKEN Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.
valid_values: ['ATTRIBUTE_FILTER', 'USER_TOKEN']
- name: UserGroupResolutionConfiguration
description: |
Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents. If you're using an Amazon Kendra Gen AI Enterprise Edition index, UserGroupResolutionConfiguration isn't supported.
value:
UserGroupResolutionMode: "{{ UserGroupResolutionMode }}"
UPDATE examples
- associate_personas_to_entities
- disassociate_personas_from_entities
- update_index
Defines the specific permissions of users or groups in your IAM Identity Center identity source with access to your Amazon Kendra experience. You can create an Amazon Kendra experience such as a search application. For more information on creating a search application experience, see Building a search experience with no code.
UPDATE aws.kendra.indexes
SET
Id = '{{ Id }}',
IndexId = '{{ IndexId }}',
Personas = '{{ Personas }}'
WHERE
region = '{{ region }}' --required
AND IndexId = '{{ IndexId }}' --required
AND Personas = '{{ Personas }}' --required
RETURNING
failed_entity_list;
Removes the specific permissions of users or groups in your IAM Identity Center identity source with access to your Amazon Kendra experience. You can create an Amazon Kendra experience such as a search application. For more information on creating a search application experience, see Building a search experience with no code.
UPDATE aws.kendra.indexes
SET
Id = '{{ Id }}',
IndexId = '{{ IndexId }}',
EntityIds = '{{ EntityIds }}'
WHERE
region = '{{ region }}' --required
AND IndexId = '{{ IndexId }}' --required
AND EntityIds = '{{ EntityIds }}' --required
RETURNING
failed_entity_list;
Updates an Amazon Kendra index.
UPDATE aws.kendra.indexes
SET
Id = '{{ Id }}',
Name = '{{ Name }}',
RoleArn = '{{ RoleArn }}',
Description = '{{ Description }}',
DocumentMetadataConfigurationUpdates = '{{ DocumentMetadataConfigurationUpdates }}',
CapacityUnits = '{{ CapacityUnits }}',
UserTokenConfigurations = '{{ UserTokenConfigurations }}',
UserContextPolicy = '{{ UserContextPolicy }}',
UserGroupResolutionConfiguration = '{{ UserGroupResolutionConfiguration }}'
WHERE
region = '{{ region }}' --required;
DELETE examples
- delete_index
Deletes an Amazon Kendra index. An exception is not thrown if the index is already being deleted. While the index is being deleted, the Status field returned by a call to the DescribeIndex API is set to DELETING.
DELETE FROM aws.kendra.indexes
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- batch_delete_document
- batch_put_document
- query
- retrieve
- submit_feedback
Removes one or more documents from an index. The documents must have been added with the BatchPutDocument API. The documents are deleted asynchronously. You can see the progress of the deletion by using Amazon Web Services CloudWatch. Any error messages related to the processing of the batch are sent to your Amazon Web Services CloudWatch log. You can also use the BatchGetDocumentStatus API to monitor the progress of deleting your documents. Deleting documents from an index using BatchDeleteDocument could take up to an hour or more, depending on the number of documents you want to delete.
EXEC aws.kendra.indexes.batch_delete_document
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"DocumentIdList": "{{ DocumentIdList }}",
"DataSourceSyncJobMetricTarget": "{{ DataSourceSyncJobMetricTarget }}"
}'
;
Adds one or more documents to an index. The BatchPutDocument API enables you to ingest inline documents or a set of documents stored in an Amazon S3 bucket. Use this API to ingest your text and unstructured text into an index, add custom attributes to the documents, and to attach an access control list to the documents added to the index. The documents are indexed asynchronously. You can see the progress of the batch using Amazon Web Services CloudWatch. Any error messages related to processing the batch are sent to your Amazon Web Services CloudWatch log. You can also use the BatchGetDocumentStatus API to monitor the progress of indexing your documents. For an example of ingesting inline documents using Python and Java SDKs, see Adding files directly to an index.
EXEC aws.kendra.indexes.batch_put_document
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"RoleArn": "{{ RoleArn }}",
"Documents": "{{ Documents }}",
"CustomDocumentEnrichmentConfiguration": "{{ CustomDocumentEnrichmentConfiguration }}"
}'
;
Searches an index given an input query. If you are working with large language models (LLMs) or implementing retrieval augmented generation (RAG) systems, you can use Amazon Kendra's Retrieve API, which can return longer semantically relevant passages. We recommend using the Retrieve API instead of filing a service limit increase to increase the Query API document excerpt length. You can configure boosting or relevance tuning at the query level to override boosting at the index level, filter based on document fields/attributes and faceted search, and filter based on the user or their group access to documents. You can also include certain fields in the response that might provide useful additional information. A query response contains three types of results. Relevant suggested answers. The answers can be either a text excerpt or table excerpt. The answer can be highlighted in the excerpt. Matching FAQs or questions-answer from your FAQ file. Relevant documents. This result type includes an excerpt of the document with the document title. The searched terms can be highlighted in the excerpt. You can specify that the query return only one type of result using the QueryResultTypeFilter parameter. Each query returns the 100 most relevant results. If you filter result type to only question-answers, a maximum of four results are returned. If you filter result type to only answers, a maximum of three results are returned. If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error.
EXEC aws.kendra.indexes.query
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"QueryText": "{{ QueryText }}",
"AttributeFilter": "{{ AttributeFilter }}",
"Facets": "{{ Facets }}",
"RequestedDocumentAttributes": "{{ RequestedDocumentAttributes }}",
"QueryResultTypeFilter": "{{ QueryResultTypeFilter }}",
"DocumentRelevanceOverrideConfigurations": "{{ DocumentRelevanceOverrideConfigurations }}",
"PageNumber": {{ PageNumber }},
"PageSize": {{ PageSize }},
"SortingConfiguration": "{{ SortingConfiguration }}",
"SortingConfigurations": "{{ SortingConfigurations }}",
"UserContext": "{{ UserContext }}",
"VisitorId": "{{ VisitorId }}",
"SpellCorrectionConfiguration": "{{ SpellCorrectionConfiguration }}",
"CollapseConfiguration": "{{ CollapseConfiguration }}"
}'
;
Retrieves relevant passages or text excerpts given an input query. This API is similar to the Query API. However, by default, the Query API only returns excerpt passages of up to 100 token words. With the Retrieve API, you can retrieve longer passages of up to 200 token words and up to 100 semantically relevant passages. This doesn't include question-answer or FAQ type responses from your index. The passages are text excerpts that can be semantically extracted from multiple documents and multiple parts of the same document. If in extreme cases your documents produce zero passages using the Retrieve API, you can alternatively use the Query API and its types of responses. You can also do the following: Override boosting at the index level Filter based on document fields or attributes Filter based on the user or their group access to documents View the confidence score bucket for a retrieved passage result. The confidence bucket provides a relative ranking that indicates how confident Amazon Kendra is that the response is relevant to the query. Confidence score buckets are currently available only for English. You can also include certain fields in the response that might provide useful additional information. The Retrieve API shares the number of query capacity units that you set for your index. For more information on what's included in a single capacity unit and the default base capacity for an index, see Adjusting capacity. If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error.
EXEC aws.kendra.indexes.retrieve
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"QueryText": "{{ QueryText }}",
"AttributeFilter": "{{ AttributeFilter }}",
"RequestedDocumentAttributes": "{{ RequestedDocumentAttributes }}",
"DocumentRelevanceOverrideConfigurations": "{{ DocumentRelevanceOverrideConfigurations }}",
"PageNumber": {{ PageNumber }},
"PageSize": {{ PageSize }},
"UserContext": "{{ UserContext }}"
}'
;
Enables you to provide feedback to Amazon Kendra to improve the performance of your index. SubmitFeedback is currently not supported in the Amazon Web Services GovCloud (US-West) region.
EXEC aws.kendra.indexes.submit_feedback
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"QueryId": "{{ QueryId }}",
"ClickFeedbackItems": "{{ ClickFeedbackItems }}",
"RelevanceFeedbackItems": "{{ RelevanceFeedbackItems }}"
}'
;