Skip to content

QueryResultItem

Source code in docs_src/capo_kendra/types/query_result_item.py
class QueryResultItem(TypedDict, closed=True):
    id: NotRequired["capo_kendra.types.result_id.ResultId"]
    """<p>The unique identifier for the query result item id (<code>Id</code>) and the query result item document id (<code>DocumentId</code>) combined. The value of this field changes with every request, even when you have the same documents.</p>"""
    type: NotRequired["capo_kendra.types.query_result_type.QueryResultType"]
    """<p>The type of document within the response. For example, a response could include a question-answer that's relevant to the query.</p>"""
    format: NotRequired["capo_kendra.types.query_result_format.QueryResultFormat"]
    """<p>If the <code>Type</code> of document within the response is <code>ANSWER</code>, then it is either a <code>TABLE</code> answer or <code>TEXT</code> answer. If it's a table answer, a table excerpt is returned in <code>TableExcerpt</code>. If it's a text answer, a text excerpt is returned in <code>DocumentExcerpt</code>.</p>"""
    additional_attributes: NotRequired[
        "capo_kendra.types.additional_result_attribute_list.AdditionalResultAttributeList"
    ]
    """<p>One or more additional fields/attributes associated with the query result.</p>"""
    document_id: NotRequired["capo_kendra.types.document_id.DocumentId"]
    """<p>The identifier for the document.</p>"""
    document_title: NotRequired[
        "capo_kendra.types.text_with_highlights.TextWithHighlights"
    ]
    """<p>The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.</p>"""
    document_excerpt: NotRequired[
        "capo_kendra.types.text_with_highlights.TextWithHighlights"
    ]
    """<p>An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.</p>"""
    document_uri: NotRequired["capo_kendra.types.url.Url"]
    """<p>The URI of the original location of the document.</p>"""
    document_attributes: NotRequired[
        "capo_kendra.types.document_attribute_list.DocumentAttributeList"
    ]
    """<p>An array of document fields/attributes assigned to a document in the search results. For example, the document author (<code>_author</code>) or the source URI (<code>_source_uri</code>) of the document.</p>"""
    score_attributes: NotRequired["capo_kendra.types.score_attributes.ScoreAttributes"]
    """<p>Indicates the confidence level of Amazon Kendra providing a relevant result for the query. Each result is placed into a bin that indicates the confidence, <code>VERY_HIGH</code>, <code>HIGH</code>, <code>MEDIUM</code> and <code>LOW</code>. You can use the score to determine if a response meets the confidence needed for your application.</p> <p>The field is only set to <code>LOW</code> when the <code>Type</code> field is set to <code>DOCUMENT</code> and Amazon Kendra is not confident that the result is relevant to the query.</p>"""
    feedback_token: NotRequired["capo_kendra.types.feedback_token.FeedbackToken"]
    """<p>A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/submitting-feedback.html">Submitting feedback</a>.</p>"""
    table_excerpt: NotRequired["capo_kendra.types.table_excerpt.TableExcerpt"]
    """<p>An excerpt from a table within a document.</p>"""
    collapsed_result_detail: NotRequired[
        "capo_kendra.types.collapsed_result_detail.CollapsedResultDetail"
    ]
    """<p>Provides details about a collapsed group of search results.</p>"""

additional_attributes instance-attribute

additional_attributes: NotRequired[AdditionalResultAttributeList]

One or more additional fields/attributes associated with the query result.

collapsed_result_detail instance-attribute

collapsed_result_detail: NotRequired[CollapsedResultDetail]

Provides details about a collapsed group of search results.

document_attributes instance-attribute

document_attributes: NotRequired[DocumentAttributeList]

An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author) or the source URI (_source_uri) of the document.

document_excerpt instance-attribute

document_excerpt: NotRequired[TextWithHighlights]

An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.

document_id instance-attribute

document_id: NotRequired[DocumentId]

The identifier for the document.

document_title instance-attribute

document_title: NotRequired[TextWithHighlights]

The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.

document_uri instance-attribute

document_uri: NotRequired[Url]

The URI of the original location of the document.

feedback_token instance-attribute

feedback_token: NotRequired[FeedbackToken]

A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see Submitting feedback.

format instance-attribute

format: NotRequired[QueryResultFormat]

If the Type of document within the response is ANSWER, then it is either a TABLE answer or TEXT answer. If it's a table answer, a table excerpt is returned in TableExcerpt. If it's a text answer, a text excerpt is returned in DocumentExcerpt.

id instance-attribute

id: NotRequired[ResultId]

The unique identifier for the query result item id (Id) and the query result item document id (DocumentId) combined. The value of this field changes with every request, even when you have the same documents.

score_attributes instance-attribute

score_attributes: NotRequired[ScoreAttributes]

Indicates the confidence level of Amazon Kendra providing a relevant result for the query. Each result is placed into a bin that indicates the confidence, VERY_HIGH, HIGH, MEDIUM and LOW. You can use the score to determine if a response meets the confidence needed for your application.

The field is only set to LOW when the Type field is set to DOCUMENT and Amazon Kendra is not confident that the result is relevant to the query.

table_excerpt instance-attribute

table_excerpt: NotRequired[TableExcerpt]

An excerpt from a table within a document.

type instance-attribute

type: NotRequired[QueryResultType]

The type of document within the response. For example, a response could include a question-answer that's relevant to the query.