public class SearchResponse extends ActionResponse implements StatusToXContent
TransportResponse.Empty
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
headers
EMPTY_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, remoteAddress
contextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContext
public SearchResponse()
public SearchResponse(InternalSearchResponse internalResponse, String scrollId, int totalShards, int successfulShards, long tookInMillis, ShardSearchFailure[] shardFailures)
public RestStatus status()
StatusToXContent
status
in interface StatusToXContent
public SearchHits getHits()
public Aggregations getAggregations()
public Suggest getSuggest()
public boolean isTimedOut()
public Boolean isTerminatedEarly()
terminateAfter
public 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 ToXContent
IOException
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class ActionResponse
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class ActionResponse
IOException
Copyright © 2009–2016. All rights reserved.