Skip to content

RetrieveRequest

Source code in docs_src/capo_kendra/types/retrieve_request.py
class RetrieveRequest(TypedDict, closed=True):
    index_id: "capo_kendra.types.index_id.IndexId"
    """<p>The identifier of the index to retrieve relevant passages for the search.</p>"""
    query_text: "capo_kendra.types.query_text.QueryText"
    """<p>The input query text to retrieve relevant passages for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, <code>Timeoff AND October AND Category:HR</code> is counted as 3 tokens: <code>timeoff</code>, <code>october</code>, <code>hr</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching with advanced query syntax</a> in the Amazon Kendra Developer Guide. </p>"""
    attribute_filter: NotRequired["capo_kendra.types.attribute_filter.AttributeFilter"]
    """<p>Filters search results by document fields/attributes. You can only provide one attribute filter; however, the <code>AndAllFilters</code>, <code>NotFilter</code>, and <code>OrAllFilters</code> parameters contain a list of other filters.</p> <p>The <code>AttributeFilter</code> parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.</p> <note> <p>For Amazon Kendra Gen AI Enterprise Edition indices use <code>AttributeFilter</code> to enable document filtering for end users using <code>_email_id</code> or include public documents (<code>_email_id=null</code>).</p> </note>"""
    requested_document_attributes: NotRequired[
        "capo_kendra.types.document_attribute_key_list.DocumentAttributeKeyList"
    ]
    """<p>A list of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document fields are included in the response.</p>"""
    document_relevance_override_configurations: NotRequired[
        "capo_kendra.types.document_relevance_override_configuration_list.DocumentRelevanceOverrideConfigurationList"
    ]
    """<p>Overrides relevance tuning configurations of fields/attributes set at the index level.</p> <p>If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.</p> <p>If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.</p>"""
    page_number: NotRequired["capo_kendra.types.integer.Integer"]
    """<p>Retrieved relevant passages are returned in pages the size of the <code>PageSize</code> parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.</p>"""
    page_size: NotRequired["capo_kendra.types.integer.Integer"]
    """<p>Sets the number of retrieved relevant passages that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.</p>"""
    user_context: NotRequired["capo_kendra.types.user_context.UserContext"]
    """<p>The user context token or user and group information.</p>"""

attribute_filter instance-attribute

attribute_filter: NotRequired[AttributeFilter]

Filters search results by document fields/attributes. You can only provide one attribute filter; however, the AndAllFilters, NotFilter, and OrAllFilters parameters contain a list of other filters.

The AttributeFilter parameter means you can create a set of filtering rules that a document must satisfy to be included in the query results.

For Amazon Kendra Gen AI Enterprise Edition indices use AttributeFilter to enable document filtering for end users using _email_id or include public documents (_email_id=null).

document_relevance_override_configurations instance-attribute

document_relevance_override_configurations: NotRequired[
    DocumentRelevanceOverrideConfigurationList
]

Overrides relevance tuning configurations of fields/attributes set at the index level.

If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning.

If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1.

index_id instance-attribute

index_id: IndexId

The identifier of the index to retrieve relevant passages for the search.

page_number instance-attribute

page_number: NotRequired[Integer]

Retrieved relevant passages are returned in pages the size of the PageSize parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one.

page_size instance-attribute

page_size: NotRequired[Integer]

Sets the number of retrieved relevant passages that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.

query_text instance-attribute

query_text: QueryText

The input query text to retrieve relevant passages for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, Timeoff AND October AND Category:HR is counted as 3 tokens: timeoff, october, hr. For more information, see Searching with advanced query syntax in the Amazon Kendra Developer Guide.

requested_document_attributes instance-attribute

requested_document_attributes: NotRequired[DocumentAttributeKeyList]

A list of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document fields are included in the response.

user_context instance-attribute

user_context: NotRequired[UserContext]

The user context token or user and group information.