public final class QuerySearchResult extends SearchPhaseResult
TransportResponse.Empty
requestId
Constructor and Description |
---|
QuerySearchResult() |
QuerySearchResult(long id,
SearchShardTarget shardTarget) |
Modifier and Type | Method and Description |
---|---|
void |
aggregations(InternalAggregations aggregations) |
Aggregations |
consumeAggs()
Returns and nulls out the aggregation for this search results.
|
ProfileShardResult |
consumeProfileResult()
Returns and nulls out the profiled results for this search, or potentially null if result was empty.
|
org.apache.lucene.search.TopDocs |
consumeTopDocs()
Returns and nulls out the top docs for this search results.
|
int |
from() |
QuerySearchResult |
from(int from) |
float |
getMaxScore() |
int |
getTotalHits() |
boolean |
hasAggs()
Returns
true if this query result has unconsumed aggregations |
boolean |
hasConsumedTopDocs()
Returns
true iff the top docs have already been consumed. |
boolean |
hasProfileResults() |
boolean |
hasSearchContext() |
boolean |
hasSuggestHits()
Returns
true if this result has any suggest score docs |
java.util.List<SiblingPipelineAggregator> |
pipelineAggregators() |
void |
pipelineAggregators(java.util.List<SiblingPipelineAggregator> pipelineAggregators) |
void |
profileResults(ProfileShardResult shardResults)
Sets the finalized profiling results for this query
|
QuerySearchResult |
queryResult()
Returns the query result iff it's included in this response otherwise
null |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
void |
readFromWithId(long id,
StreamInput in) |
static QuerySearchResult |
readQuerySearchResult(StreamInput in) |
boolean |
searchTimedOut() |
void |
searchTimedOut(boolean searchTimedOut) |
int |
size()
Returns the maximum size of this results top docs.
|
QuerySearchResult |
size(int size) |
DocValueFormat[] |
sortValueFormats() |
Suggest |
suggest() |
void |
suggest(Suggest suggest) |
java.lang.Boolean |
terminatedEarly() |
void |
terminatedEarly(boolean terminatedEarly) |
org.apache.lucene.search.TopDocs |
topDocs() |
void |
topDocs(org.apache.lucene.search.TopDocs topDocs,
DocValueFormat[] sortValueFormats) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
void |
writeToNoId(StreamOutput out) |
fetchResult, getRequestId, getSearchShardTarget, getShardIndex, setSearchShardTarget, setShardIndex
remoteAddress, remoteAddress
public QuerySearchResult()
public QuerySearchResult(long id, SearchShardTarget shardTarget)
public QuerySearchResult queryResult()
SearchPhaseResult
null
queryResult
in class SearchPhaseResult
public void searchTimedOut(boolean searchTimedOut)
public boolean searchTimedOut()
public void terminatedEarly(boolean terminatedEarly)
public java.lang.Boolean terminatedEarly()
public org.apache.lucene.search.TopDocs topDocs()
public boolean hasConsumedTopDocs()
true
iff the top docs have already been consumed.public org.apache.lucene.search.TopDocs consumeTopDocs()
java.lang.IllegalStateException
- if the top docs have already been consumed.public void topDocs(org.apache.lucene.search.TopDocs topDocs, DocValueFormat[] sortValueFormats)
public DocValueFormat[] sortValueFormats()
public boolean hasAggs()
true
if this query result has unconsumed aggregationspublic Aggregations consumeAggs()
java.lang.IllegalStateException
- if the aggregations have already been consumed.public void aggregations(InternalAggregations aggregations)
public ProfileShardResult consumeProfileResult()
java.lang.IllegalStateException
- if the profiled result has already been consumed.public boolean hasProfileResults()
public void profileResults(ProfileShardResult shardResults)
shardResults
- The finalized profilepublic java.util.List<SiblingPipelineAggregator> pipelineAggregators()
public void pipelineAggregators(java.util.List<SiblingPipelineAggregator> pipelineAggregators)
public Suggest suggest()
public void suggest(Suggest suggest)
public int from()
public QuerySearchResult from(int from)
public int size()
public QuerySearchResult size(int size)
public boolean hasSuggestHits()
true
if this result has any suggest score docspublic boolean hasSearchContext()
public static QuerySearchResult readQuerySearchResult(StreamInput in) throws java.io.IOException
java.io.IOException
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class TransportMessage
java.io.IOException
public void readFromWithId(long id, StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class TransportMessage
java.io.IOException
public void writeToNoId(StreamOutput out) throws java.io.IOException
java.io.IOException
public int getTotalHits()
public float getMaxScore()