Interface QueryResponse.Builder

All Superinterfaces:
AwsResponse.Builder, Buildable, CopyableBuilder<QueryResponse.Builder,QueryResponse>, KendraResponse.Builder, SdkBuilder<QueryResponse.Builder,QueryResponse>, SdkPojo, SdkResponse.Builder
Enclosing class:
QueryResponse

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

    • queryId

      QueryResponse.Builder queryId(String queryId)

      The identifier for the search. You also use QueryId to identify the search when using the SubmitFeedback API.

      Parameters:
      queryId - The identifier for the search. You also use QueryId to identify the search when using the SubmitFeedback API.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • resultItems

      The results of the search.

      Parameters:
      resultItems - The results of the search.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • resultItems

      QueryResponse.Builder resultItems(QueryResultItem... resultItems)

      The results of the search.

      Parameters:
      resultItems - The results of the search.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • resultItems

      The results of the search.

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

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

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

      QueryResponse.Builder facetResults(Collection<FacetResult> facetResults)

      Contains the facet results. A FacetResult contains the counts for each field/attribute key that was specified in the Facets input parameter.

      Parameters:
      facetResults - Contains the facet results. A FacetResult contains the counts for each field/attribute key that was specified in the Facets input parameter.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • facetResults

      QueryResponse.Builder facetResults(FacetResult... facetResults)

      Contains the facet results. A FacetResult contains the counts for each field/attribute key that was specified in the Facets input parameter.

      Parameters:
      facetResults - Contains the facet results. A FacetResult contains the counts for each field/attribute key that was specified in the Facets input parameter.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • facetResults

      QueryResponse.Builder facetResults(Consumer<FacetResult.Builder>... facetResults)

      Contains the facet results. A FacetResult contains the counts for each field/attribute key that was specified in the Facets input parameter.

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

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

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

      QueryResponse.Builder totalNumberOfResults(Integer totalNumberOfResults)

      The total number of items found by the search. However, you can only retrieve up to 100 items. For example, if the search found 192 items, you can only retrieve the first 100 of the items.

      Parameters:
      totalNumberOfResults - The total number of items found by the search. However, you can only retrieve up to 100 items. For example, if the search found 192 items, you can only retrieve the first 100 of the items.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • warnings

      A list of warning codes and their messages on problems with your query.

      Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the query. For examples of invalid query syntax, see Searching with advanced query syntax.

      Parameters:
      warnings - A list of warning codes and their messages on problems with your query.

      Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the query. For examples of invalid query syntax, see Searching with advanced query syntax.

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

      QueryResponse.Builder warnings(Warning... warnings)

      A list of warning codes and their messages on problems with your query.

      Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the query. For examples of invalid query syntax, see Searching with advanced query syntax.

      Parameters:
      warnings - A list of warning codes and their messages on problems with your query.

      Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the query. For examples of invalid query syntax, see Searching with advanced query syntax.

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

      A list of warning codes and their messages on problems with your query.

      Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the query. For examples of invalid query syntax, see Searching with advanced query syntax.

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

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

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

      QueryResponse.Builder spellCorrectedQueries(Collection<SpellCorrectedQuery> spellCorrectedQueries)

      A list of information related to suggested spell corrections for a query.

      Parameters:
      spellCorrectedQueries - A list of information related to suggested spell corrections for a query.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • spellCorrectedQueries

      QueryResponse.Builder spellCorrectedQueries(SpellCorrectedQuery... spellCorrectedQueries)

      A list of information related to suggested spell corrections for a query.

      Parameters:
      spellCorrectedQueries - A list of information related to suggested spell corrections for a query.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • spellCorrectedQueries

      QueryResponse.Builder spellCorrectedQueries(Consumer<SpellCorrectedQuery.Builder>... spellCorrectedQueries)

      A list of information related to suggested spell corrections for a query.

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

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

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

      QueryResponse.Builder featuredResultsItems(Collection<FeaturedResultsItem> featuredResultsItems)

      The list of featured result items. Featured results are displayed at the top of the search results page, placed above all other results for certain queries. If there's an exact match of a query, then certain documents are featured in the search results.

      Parameters:
      featuredResultsItems - The list of featured result items. Featured results are displayed at the top of the search results page, placed above all other results for certain queries. If there's an exact match of a query, then certain documents are featured in the search results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • featuredResultsItems

      QueryResponse.Builder featuredResultsItems(FeaturedResultsItem... featuredResultsItems)

      The list of featured result items. Featured results are displayed at the top of the search results page, placed above all other results for certain queries. If there's an exact match of a query, then certain documents are featured in the search results.

      Parameters:
      featuredResultsItems - The list of featured result items. Featured results are displayed at the top of the search results page, placed above all other results for certain queries. If there's an exact match of a query, then certain documents are featured in the search results.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • featuredResultsItems

      QueryResponse.Builder featuredResultsItems(Consumer<FeaturedResultsItem.Builder>... featuredResultsItems)

      The list of featured result items. Featured results are displayed at the top of the search results page, placed above all other results for certain queries. If there's an exact match of a query, then certain documents are featured in the search results.

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

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

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