Skip to content

QueryRequest

Source code in docs_src/capo_kendra/types/query_request.py
class QueryRequest(TypedDict, closed=True):
    index_id: "capo_kendra.types.index_id.IndexId"
    """<p>The identifier of the index for the search.</p>"""
    query_text: NotRequired["capo_kendra.types.query_text.QueryText"]
    """<p>The input query text 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>"""
    facets: NotRequired["capo_kendra.types.facet_list.FacetList"]
    """<p>An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.</p>"""
    requested_document_attributes: NotRequired[
        "capo_kendra.types.document_attribute_key_list.DocumentAttributeKeyList"
    ]
    """<p>An array of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document attributes are included in the response.</p>"""
    query_result_type_filter: NotRequired[
        "capo_kendra.types.query_result_type.QueryResultType"
    ]
    """<p>Sets the type of query result or response. Only results for the specified type are returned.</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>Query results 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 results 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>"""
    sorting_configuration: NotRequired[
        "capo_kendra.types.sorting_configuration.SortingConfiguration"
    ]
    """<p>Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.</p> <p>If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.</p>"""
    sorting_configurations: NotRequired[
        "capo_kendra.types.sorting_configuration_list.SortingConfigurationList"
    ]
    """<p>Provides configuration information to determine how the results of a query are sorted.</p> <p>You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.</p> <p>If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance. </p>"""
    user_context: NotRequired["capo_kendra.types.user_context.UserContext"]
    """<p>The user context token or user and group information.</p>"""
    visitor_id: NotRequired["capo_kendra.types.visitor_id.VisitorId"]
    """<p>Provides an identifier for a specific user. The <code>VisitorId</code> should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the <code>VisitorId</code>.</p>"""
    spell_correction_configuration: NotRequired[
        "capo_kendra.types.spell_correction_configuration.SpellCorrectionConfiguration"
    ]
    """<p>Enables suggested spell corrections for queries.</p>"""
    collapse_configuration: NotRequired[
        "capo_kendra.types.collapse_configuration.CollapseConfiguration"
    ]
    """<p>Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.</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).

collapse_configuration instance-attribute

collapse_configuration: NotRequired[CollapseConfiguration]

Provides configuration to determine how to group results by document attribute value, and how to display them (collapsed or expanded) under a designated primary document for each group.

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.

facets instance-attribute

facets: NotRequired[FacetList]

An array of documents fields/attributes for faceted search. Amazon Kendra returns a count for each field key specified. This helps your users narrow their search.

index_id instance-attribute

index_id: IndexId

The identifier of the index for the search.

page_number instance-attribute

page_number: NotRequired[Integer]

Query results 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 results 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_result_type_filter instance-attribute

query_result_type_filter: NotRequired[QueryResultType]

Sets the type of query result or response. Only results for the specified type are returned.

query_text instance-attribute

query_text: NotRequired[QueryText]

The input query text 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]

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

sorting_configuration instance-attribute

sorting_configuration: NotRequired[SortingConfiguration]

Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.

If you don't provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.

sorting_configurations instance-attribute

sorting_configurations: NotRequired[SortingConfigurationList]

Provides configuration information to determine how the results of a query are sorted.

You can set upto 3 fields that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. The sort field quota can be increased.

If you don't provide a sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result. In the case of ties in sorting the results, the results are sorted by relevance.

spell_correction_configuration instance-attribute

spell_correction_configuration: NotRequired[SpellCorrectionConfiguration]

Enables suggested spell corrections for queries.

user_context instance-attribute

user_context: NotRequired[UserContext]

The user context token or user and group information.

visitor_id instance-attribute

visitor_id: NotRequired[VisitorId]

Provides an identifier for a specific user. The VisitorId should be a unique identifier, such as a GUID. Don't use personally identifiable information, such as the user's email address, as the VisitorId.