public class SearchResponse extends ActionResponse implements StatusToXContent
TransportResponse.EmptyToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsheadersEMPTY_PARAMS| Constructor and Description |
|---|
SearchResponse() |
SearchResponse(InternalSearchResponse internalResponse,
String scrollId,
int totalShards,
int successfulShards,
long tookInMillis,
ShardSearchFailure[] shardFailures) |
| Modifier and Type | Method and Description |
|---|---|
Aggregations |
getAggregations() |
int |
getFailedShards()
The failed number of shards the search was executed on.
|
SearchHits |
getHits()
The search hits.
|
Map<String,List<ProfileShardResult>> |
getProfileResults()
If profiling was enabled, this returns an object containing the profile results from
each shard.
|
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 |
getSuccessfulShards()
The successful number of shards the search was executed on.
|
Suggest |
getSuggest() |
TimeValue |
getTook()
How long the search took.
|
long |
getTookInMillis()
How long the search took in milliseconds.
|
int |
getTotalShards()
The total number of shards the search was executed on.
|
Boolean |
isTerminatedEarly()
Has the search operation terminated early due to reaching
terminateAfter |
boolean |
isTimedOut()
Has the search operation timed out.
|
void |
readFrom(StreamInput in) |
void |
scrollId(String scrollId) |
RestStatus |
status()
Returns the REST status to make sure it is returned correctly
|
String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out) |
remoteAddress, remoteAddresscontextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContextpublic SearchResponse()
public SearchResponse(InternalSearchResponse internalResponse, String scrollId, int totalShards, int successfulShards, long tookInMillis, ShardSearchFailure[] shardFailures)
public RestStatus status()
StatusToXContentstatus in interface StatusToXContentpublic SearchHits getHits()
public Aggregations getAggregations()
public Suggest getSuggest()
public boolean isTimedOut()
public Boolean isTerminatedEarly()
terminateAfterpublic TimeValue getTook()
public long getTookInMillis()
public int getTotalShards()
public int getSuccessfulShards()
public int getFailedShards()
public ShardSearchFailure[] getShardFailures()
public String getScrollId()
SearchRequest.scroll(org.elasticsearch.search.Scroll), the
scroll id that can be used to continue scrolling.public void scrollId(String scrollId)
@Nullable public Map<String,List<ProfileShardResult>> getProfileResults()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent in interface ToXContentIOExceptionpublic void readFrom(StreamInput in) throws IOException
readFrom in interface StreamablereadFrom in class ActionResponseIOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamablewriteTo in class ActionResponseIOExceptionCopyright © 2009–2017. All rights reserved.