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 Summary
Modifier and TypeMethodDescriptiongetAggregationResult
(String name) long
getCount()
List<com.liferay.portal.kernel.search.Document>
Returns the map containing the top hits aggregations for each field.Returns the request string that was submitted to the search engine.Returns the response string as returned by the search engine.Returns the map containing the metrics aggregations computed by the search engine.int
void
withFacetContext
(Consumer<FacetContext> facetContextConsumer) <T> T
withFacetContextGet
(Function<FacetContext, T> facetContextFunction) void
<T> T
withHitsGet
(Function<com.liferay.portal.kernel.search.Hits, T> hitsFunction) void
withSearchContext
(Consumer<com.liferay.portal.kernel.search.SearchContext> searchContextConsumer) <T> T
withSearchContextGet
(Function<com.liferay.portal.kernel.search.SearchContext, T> searchContextFunction)
-
Method Details
-
getAggregationResult
-
getAggregationResultsMap
Map<String,AggregationResult> getAggregationResultsMap() -
getCount
long getCount() -
getDocuments
-
getDocuments71
List<com.liferay.portal.kernel.search.Document> getDocuments71() -
getFederatedSearchKey
String getFederatedSearchKey() -
getFederatedSearchResponse
-
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 withSearchRequest.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
-
withFacetContextGet
-
withHits
-
withHitsGet
-
withSearchContext
void withSearchContext(Consumer<com.liferay.portal.kernel.search.SearchContext> searchContextConsumer) -
withSearchContextGet
<T> T withSearchContextGet(Function<com.liferay.portal.kernel.search.SearchContext, T> searchContextFunction)
-