Module org.elasticsearch.server
Package org.elasticsearch.action.search
Class SearchResponseSections
java.lang.Object
org.elasticsearch.action.search.SearchResponseSections
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable
Holds some sections that a search response is composed of (hits, aggs, suggestions etc.) during some steps of the search response
building.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InternalAggregationsstatic final SearchResponseSectionsstatic final SearchResponseSectionsprotected final SearchHitsprotected final intprotected final SearchProfileResultsprotected final Suggestprotected final Booleanprotected final booleanprotected final Long -
Constructor Summary
ConstructorsConstructorDescriptionSearchResponseSections(SearchHits hits, InternalAggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases, Long timeRangeFilterFromMillis) SearchResponseSections(SearchHits hits, InternalAggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases, Long timeRangeFilterFromMillis, List<SearchHits> topHitsToRelease) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final SearchHitshits()final Map<String, SearchProfileShardResult> profile()Returns the profile results for this search response (including all shards).final Suggestsuggest()final List<SearchHits> Transfers ownership of the top-hits-to-release list to the caller.
-
Field Details
-
EMPTY_WITH_TOTAL_HITS
-
EMPTY_WITHOUT_TOTAL_HITS
-
hits
-
aggregations
-
suggest
-
profileResults
-
timedOut
protected final boolean timedOut -
terminatedEarly
-
numReducePhases
protected final int numReducePhases -
timeRangeFilterFromMillis
-
-
Constructor Details
-
SearchResponseSections
public SearchResponseSections(SearchHits hits, InternalAggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases, Long timeRangeFilterFromMillis) -
SearchResponseSections
public SearchResponseSections(SearchHits hits, InternalAggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases, Long timeRangeFilterFromMillis, @Nullable List<SearchHits> topHitsToRelease)
-
-
Method Details
-
transferTopHitsToRelease
Transfers ownership of the top-hits-to-release list to the caller. Call when building a SearchResponse so close() does not release the list. Returns null if the list was already transferred or was never set. -
hits
-
suggest
-
profile
Returns the profile results for this search response (including all shards). An empty map is returned if profiling was not enabled- Returns:
- Profile results
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-