Package org.elasticsearch.action.search
Class SearchResponseSections
java.lang.Object
org.elasticsearch.action.search.SearchResponseSections
- All Implemented Interfaces:
ToXContent,ToXContentFragment
- Direct Known Subclasses:
InternalSearchResponse
public class SearchResponseSections extends java.lang.Object implements ToXContentFragment
Base class that holds the various sections which a search response is
composed of (hits, aggs, suggestions etc.) and allows to retrieve them.
The reason why this class exists is that the high level REST client uses its own classes
to parse aggregations into, which are not serializable. This is the common part that can be
shared between core and client.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
Fields Modifier and Type Field Description protected Aggregationsaggregationsprotected SearchHitshitsprotected intnumReducePhasesprotected SearchProfileShardResultsprofileResultsprotected Suggestsuggestprotected java.lang.BooleanterminatedEarlyprotected booleantimedOut -
Constructor Summary
Constructors Constructor Description SearchResponseSections(SearchHits hits, Aggregations aggregations, Suggest suggest, boolean timedOut, java.lang.Boolean terminatedEarly, SearchProfileShardResults profileResults, int numReducePhases) -
Method Summary
Modifier and Type Method Description Aggregationsaggregations()intgetNumReducePhases()Returns the number of reduce phases applied to obtain this search responseSearchHitshits()java.util.Map<java.lang.String,ProfileShardResult>profile()Returns the profile results for this search response (including all shards).Suggestsuggest()java.lang.BooleanterminatedEarly()booleantimedOut()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)protected voidwriteTo(StreamOutput out)
-
Field Details
-
hits
-
aggregations
-
suggest
-
profileResults
-
timedOut
protected final boolean timedOut -
terminatedEarly
protected final java.lang.Boolean terminatedEarly -
numReducePhases
protected final int numReducePhases
-
-
Constructor Details
-
SearchResponseSections
public SearchResponseSections(SearchHits hits, Aggregations aggregations, Suggest suggest, boolean timedOut, java.lang.Boolean terminatedEarly, SearchProfileShardResults profileResults, int numReducePhases)
-
-
Method Details
-
timedOut
public final boolean timedOut() -
terminatedEarly
public final java.lang.Boolean terminatedEarly() -
hits
-
aggregations
-
suggest
-
getNumReducePhases
public final int getNumReducePhases()Returns the number of reduce phases applied to obtain this search response -
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
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
writeTo
- Throws:
java.io.IOException
-