Package org.elasticsearch.action.search
Class SearchResponseSections
java.lang.Object
org.elasticsearch.action.search.SearchResponseSections
- All Implemented Interfaces:
ToXContent
,ToXContentFragment
- Direct Known Subclasses:
InternalSearchResponse
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.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Aggregations
protected final SearchHits
protected final int
protected final SearchProfileResults
protected final Suggest
protected final Boolean
protected final boolean
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionSearchResponseSections
(SearchHits hits, Aggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases) -
Method Summary
Modifier and TypeMethodDescriptionfinal Aggregations
final int
Returns the number of reduce phases applied to obtain this search responsefinal SearchHits
hits()
final Map<String,
SearchProfileShardResult> profile()
Returns the profile results for this search response (including all shards).final Suggest
suggest()
final Boolean
final boolean
timedOut()
final XContentBuilder
toXContent
(XContentBuilder builder, ToXContent.Params params) protected void
writeTo
(StreamOutput out) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
hits
-
aggregations
-
suggest
-
profileResults
-
timedOut
protected final boolean timedOut -
terminatedEarly
-
numReducePhases
protected final int numReducePhases
-
-
Constructor Details
-
SearchResponseSections
public SearchResponseSections(SearchHits hits, Aggregations aggregations, Suggest suggest, boolean timedOut, Boolean terminatedEarly, SearchProfileResults profileResults, int numReducePhases)
-
-
Method Details
-
timedOut
public final boolean timedOut() -
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 IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
writeTo
- Throws:
IOException
-