Interface QueryResponse.Builder

    • Method Detail

      • 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

        QueryResponse.Builder resultItems​(Collection<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

        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.
      • 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).

        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:
        #facetResults(java.util.Collection)
      • 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

        QueryResponse.Builder warnings​(Collection<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

        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

        QueryResponse.Builder warnings​(Consumer<Warning.Builder>... 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).

        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:
        #warnings(java.util.Collection)
      • 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.
      • 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).

        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:
        #featuredResultsItems(java.util.Collection)