public class SearchResponse extends ActionResponse implements StatusToXContentObject
TransportResponse.Empty
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
SearchResponse() |
SearchResponse(SearchResponseSections internalResponse,
java.lang.String scrollId,
int totalShards,
int successfulShards,
int skippedShards,
long tookInMillis,
ShardSearchFailure[] shardFailures) |
Modifier and Type | Method and Description |
---|---|
static SearchResponse |
fromXContent(XContentParser parser) |
Aggregations |
getAggregations() |
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.
|
long |
getTookInMillis()
How long the search took in milliseconds.
|
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.
|
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFragment
public SearchResponse()
public SearchResponse(SearchResponseSections internalResponse, java.lang.String scrollId, int totalShards, int successfulShards, int skippedShards, long tookInMillis, ShardSearchFailure[] shardFailures)
public RestStatus status()
StatusToXContentObject
status
in interface StatusToXContentObject
public SearchHits getHits()
public Aggregations getAggregations()
public Suggest getSuggest()
public boolean isTimedOut()
public java.lang.Boolean isTerminatedEarly()
terminateAfter
public int getNumReducePhases()
public TimeValue getTook()
public long getTookInMillis()
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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOException
public static SearchResponse fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class ActionResponse
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class ActionResponse
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object