Streamable, Writeable, StatusToXContentObject, ToXContent, ToXContentObjectpublic class SearchResponse extends ActionResponse implements StatusToXContentObject
| Modifier and Type | Class | Description |
|---|---|---|
static class |
SearchResponse.Clusters |
Holds info about the clusters that the search was executed on: how many in total, how many of them were successful
and how many of them were skipped.
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsTransportResponse.EmptyWriteable.Reader<V>, Writeable.Writer<V>EMPTY_PARAMS| Constructor | Description |
|---|---|
SearchResponse() |
|
SearchResponse(SearchResponseSections internalResponse,
java.lang.String scrollId,
int totalShards,
int successfulShards,
int skippedShards,
long tookInMillis,
ShardSearchFailure[] shardFailures,
SearchResponse.Clusters clusters) |
| Modifier and Type | Method | Description |
|---|---|---|
static SearchResponse |
fromXContent(XContentParser parser) |
|
Aggregations |
getAggregations() |
|
SearchResponse.Clusters |
getClusters() |
Returns info about what clusters the search was executed against.
|
int |
getFailedShards() |
The failed number of shards the search was executed on.
|
SearchHits |
getHits() |
The search hits.
|
int |
getNumReducePhases() |
Returns the number of reduce phases applied to obtain this search response
|
java.util.Map<java.lang.String,ProfileShardResult> |
getProfileResults() |
If profiling was enabled, this returns an object containing the profile results from
each shard.
|
java.lang.String |
getScrollId() |
If scrolling was enabled (
SearchRequest.scroll(org.elasticsearch.search.Scroll), the
scroll id that can be used to continue scrolling. |
ShardSearchFailure[] |
getShardFailures() |
The failures that occurred during the search.
|
int |
getSkippedShards() |
The number of shards skipped due to pre-filtering
|
int |
getSuccessfulShards() |
The successful number of shards the search was executed on.
|
Suggest |
getSuggest() |
|
TimeValue |
getTook() |
How long the search took.
|
int |
getTotalShards() |
The total number of shards the search was executed on.
|
XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
|
java.lang.Boolean |
isTerminatedEarly() |
Has the search operation terminated early due to reaching
terminateAfter |
boolean |
isTimedOut() |
Has the search operation timed out.
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
void |
scrollId(java.lang.String scrollId) |
|
RestStatus |
status() |
Returns the REST status to make sure it is returned correctly
|
java.lang.String |
toString() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnewWriteableReaderisFragmentremoteAddress, remoteAddresspublic SearchResponse()
public SearchResponse(SearchResponseSections internalResponse, java.lang.String scrollId, int totalShards, int successfulShards, int skippedShards, long tookInMillis, ShardSearchFailure[] shardFailures, SearchResponse.Clusters clusters)
public RestStatus status()
StatusToXContentObjectstatus in interface StatusToXContentObjectpublic SearchHits getHits()
public Aggregations getAggregations()
public Suggest getSuggest()
public boolean isTimedOut()
public java.lang.Boolean isTerminatedEarly()
terminateAfterpublic int getNumReducePhases()
public TimeValue getTook()
public int getTotalShards()
public int getSuccessfulShards()
public int getSkippedShards()
public int getFailedShards()
public ShardSearchFailure[] getShardFailures()
public java.lang.String getScrollId()
SearchRequest.scroll(org.elasticsearch.search.Scroll), the
scroll id that can be used to continue scrolling.public void scrollId(java.lang.String scrollId)
@Nullable public java.util.Map<java.lang.String,ProfileShardResult> getProfileResults()
public SearchResponse.Clusters getClusters()
nullSearchResponse.Clusterspublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOExceptionpublic XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOExceptionpublic static SearchResponse fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ActionResponsejava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in interface WriteablewriteTo in class ActionResponsejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object