Interface SearchResponse


@ProviderType public interface SearchResponse
Contains the full response of an executed search, as returned from the search engine. The exact response format and the contents of the response depends on the search engine and the search request that was executed.
  • Method Details

    • getAggregationResult

      AggregationResult getAggregationResult(String name)
    • getAggregationResultsMap

      Map<String,AggregationResult> getAggregationResultsMap()
    • getCount

      long getCount()
    • getDocuments

      List<Document> getDocuments()
    • getDocuments71

      List<com.liferay.portal.kernel.search.Document> getDocuments71()
    • getFederatedSearchKey

      String getFederatedSearchKey()
    • getFederatedSearchResponse

      SearchResponse getFederatedSearchResponse(String key)
    • getFederatedSearchResponses

      Collection<SearchResponse> getFederatedSearchResponses()
    • getGroupByResponses

      List<GroupByResponse> getGroupByResponses()
      Returns the map containing the top hits aggregations for each field.
      Returns:
      the map containing the top hits aggregations
    • getRequest

      SearchRequest getRequest()
    • getRequestString

      String getRequestString()
      Returns the request string that was submitted to the search engine. The format of the string is dependent on the search engine.
      Returns:
      the full request string, as returned by the search engine
    • getResponseString

      String getResponseString()
      Returns the response string as returned by the search engine. This can be large depending on the number of results; it must be enabled with SearchRequest.isIncludeResponseString().
      Returns:
      the response string as returned by the search engine, or blank if disabled
    • getSearchHits

      SearchHits getSearchHits()
    • getSearchTimeValue

      SearchTimeValue getSearchTimeValue()
    • getStatsResponseMap

      Map<String,StatsResponse> getStatsResponseMap()
      Returns the map containing the metrics aggregations computed by the search engine.
      Returns:
      the map containing the metrics aggregations per field
    • getTotalHits

      int getTotalHits()
    • withFacetContext

      void withFacetContext(Consumer<FacetContext> facetContextConsumer)
    • withFacetContextGet

      <T> T withFacetContextGet(Function<FacetContext,T> facetContextFunction)
    • withHits

      void withHits(Consumer<com.liferay.portal.kernel.search.Hits> hitsConsumer)
    • withHitsGet

      <T> T withHitsGet(Function<com.liferay.portal.kernel.search.Hits,T> hitsFunction)
    • withSearchContext

      void withSearchContext(Consumer<com.liferay.portal.kernel.search.SearchContext> searchContextConsumer)
    • withSearchContextGet

      <T> T withSearchContextGet(Function<com.liferay.portal.kernel.search.SearchContext,T> searchContextFunction)