Interface QueryResultItem.Builder

All Superinterfaces:
Buildable, CopyableBuilder<QueryResultItem.Builder,QueryResultItem>, SdkBuilder<QueryResultItem.Builder,QueryResultItem>, SdkPojo
Enclosing class:
QueryResultItem

public static interface QueryResultItem.Builder extends SdkPojo, CopyableBuilder<QueryResultItem.Builder,QueryResultItem>
  • Method Details

    • id

      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.

      Parameters:
      id - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • type

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

      Parameters:
      type - The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • type

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

      Parameters:
      type - The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • format

      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.

      Parameters:
      format - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • format

      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.

      Parameters:
      format - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • additionalAttributes

      QueryResultItem.Builder additionalAttributes(Collection<AdditionalResultAttribute> additionalAttributes)

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

      Parameters:
      additionalAttributes - One or more additional fields/attributes associated with the query result.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • additionalAttributes

      QueryResultItem.Builder additionalAttributes(AdditionalResultAttribute... additionalAttributes)

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

      Parameters:
      additionalAttributes - One or more additional fields/attributes associated with the query result.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • additionalAttributes

      QueryResultItem.Builder additionalAttributes(Consumer<AdditionalResultAttribute.Builder>... additionalAttributes)

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

      This is a convenience method that creates an instance of the AdditionalResultAttribute.Builder avoiding the need to create one manually via AdditionalResultAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to additionalAttributes(List<AdditionalResultAttribute>).

      Parameters:
      additionalAttributes - a consumer that will call methods on AdditionalResultAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • documentId

      QueryResultItem.Builder documentId(String documentId)

      The identifier for the document.

      Parameters:
      documentId - The identifier for the document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentTitle

      QueryResultItem.Builder documentTitle(TextWithHighlights documentTitle)

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

      Parameters:
      documentTitle - The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentTitle

      default QueryResultItem.Builder documentTitle(Consumer<TextWithHighlights.Builder> documentTitle)

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

      This is a convenience method that creates an instance of the TextWithHighlights.Builder avoiding the need to create one manually via TextWithHighlights.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to documentTitle(TextWithHighlights).

      Parameters:
      documentTitle - a consumer that will call methods on TextWithHighlights.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • documentExcerpt

      QueryResultItem.Builder documentExcerpt(TextWithHighlights documentExcerpt)

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

      Parameters:
      documentExcerpt - An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentExcerpt

      default QueryResultItem.Builder documentExcerpt(Consumer<TextWithHighlights.Builder> documentExcerpt)

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

      This is a convenience method that creates an instance of the TextWithHighlights.Builder avoiding the need to create one manually via TextWithHighlights.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to documentExcerpt(TextWithHighlights).

      Parameters:
      documentExcerpt - a consumer that will call methods on TextWithHighlights.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • documentURI

      QueryResultItem.Builder documentURI(String documentURI)

      The URI of the original location of the document.

      Parameters:
      documentURI - The URI of the original location of the document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentAttributes

      QueryResultItem.Builder documentAttributes(Collection<DocumentAttribute> documentAttributes)

      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.

      Parameters:
      documentAttributes - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentAttributes

      QueryResultItem.Builder documentAttributes(DocumentAttribute... documentAttributes)

      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.

      Parameters:
      documentAttributes - 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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • documentAttributes

      QueryResultItem.Builder documentAttributes(Consumer<DocumentAttribute.Builder>... documentAttributes)

      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.

      This is a convenience method that creates an instance of the DocumentAttribute.Builder avoiding the need to create one manually via DocumentAttribute.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to documentAttributes(List<DocumentAttribute>).

      Parameters:
      documentAttributes - a consumer that will call methods on DocumentAttribute.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • scoreAttributes

      QueryResultItem.Builder scoreAttributes(ScoreAttributes 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.

      Parameters:
      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.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • scoreAttributes

      default QueryResultItem.Builder scoreAttributes(Consumer<ScoreAttributes.Builder> 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.

      This is a convenience method that creates an instance of the ScoreAttributes.Builder avoiding the need to create one manually via ScoreAttributes.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to scoreAttributes(ScoreAttributes).

      Parameters:
      scoreAttributes - a consumer that will call methods on ScoreAttributes.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • feedbackToken

      QueryResultItem.Builder feedbackToken(String 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.

      Parameters:
      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.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tableExcerpt

      QueryResultItem.Builder tableExcerpt(TableExcerpt tableExcerpt)

      An excerpt from a table within a document.

      Parameters:
      tableExcerpt - An excerpt from a table within a document.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • tableExcerpt

      default QueryResultItem.Builder tableExcerpt(Consumer<TableExcerpt.Builder> tableExcerpt)

      An excerpt from a table within a document.

      This is a convenience method that creates an instance of the TableExcerpt.Builder avoiding the need to create one manually via TableExcerpt.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to tableExcerpt(TableExcerpt).

      Parameters:
      tableExcerpt - a consumer that will call methods on TableExcerpt.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • collapsedResultDetail

      QueryResultItem.Builder collapsedResultDetail(CollapsedResultDetail collapsedResultDetail)

      Provides details about a collapsed group of search results.

      Parameters:
      collapsedResultDetail - Provides details about a collapsed group of search results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • collapsedResultDetail

      default QueryResultItem.Builder collapsedResultDetail(Consumer<CollapsedResultDetail.Builder> collapsedResultDetail)

      Provides details about a collapsed group of search results.

      This is a convenience method that creates an instance of the CollapsedResultDetail.Builder avoiding the need to create one manually via CollapsedResultDetail.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to collapsedResultDetail(CollapsedResultDetail).

      Parameters:
      collapsedResultDetail - a consumer that will call methods on CollapsedResultDetail.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: