java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.search.SearchPhaseResult
- All Implemented Interfaces:
Writeable,RefCounted
- Direct Known Subclasses:
CanMatchShardResponse,DfsSearchResult,FetchSearchResult,QueryFetchSearchResult,QuerySearchResult,RankFeatureResult,ScrollQueryFetchSearchResult,ScrollQuerySearchResult
This class is a base class for all search related results. It contains the shard target it
was executed against, a shard index used to reference the result on the coordinating node
and a request ID that is used to reference the request context on the executing node. The
request ID is particularly important since it is used to reference and maintain a context
across search phases to ensure the same point in time snapshot is used for querying and
fetching etc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidNull out the context id and request tracked in this instance.Returns the fetch result iff it's included in this response otherwisenullReturns the search context ID that is used to reference the search context on the executing node ornullif no context was created.intReturns the shard index in the context of the currently executing search request that is used for accounting on the coordinating nodebooleanSpecifies whether the specific search phase results are associated with an opened SearchContext on the shards that executed the request.Returns the query result iff it's included in this response otherwisenullReturns the rank feature result iff it's included in this response otherwisenullvoidsetRescoreDocIds(RescoreDocIds rescoreDocIds) voidsetSearchShardTarget(SearchShardTarget shardTarget) voidsetShardIndex(int shardIndex) voidsetShardSearchRequest(ShardSearchRequest shardSearchRequest) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Field Details
-
contextId
-
-
Constructor Details
-
SearchPhaseResult
protected SearchPhaseResult() -
SearchPhaseResult
- Throws:
IOException
-
-
Method Details
-
hasSearchContext
public boolean hasSearchContext()Specifies whether the specific search phase results are associated with an opened SearchContext on the shards that executed the request. -
getContextId
Returns the search context ID that is used to reference the search context on the executing node ornullif no context was created. -
clearContextId
public void clearContextId()Null out the context id and request tracked in this instance. This is used to mark shards for which merging results on the data node made it clear that their search context won't be used in the fetch phase. -
getShardIndex
public int getShardIndex()Returns the shard index in the context of the currently executing search request that is used for accounting on the coordinating node -
getSearchShardTarget
-
setSearchShardTarget
-
setShardIndex
public void setShardIndex(int shardIndex) -
queryResult
Returns the query result iff it's included in this response otherwisenull -
rankFeatureResult
Returns the rank feature result iff it's included in this response otherwisenull -
fetchResult
Returns the fetch result iff it's included in this response otherwisenull -
getShardSearchRequest
-
setShardSearchRequest
-
getRescoreDocIds
-
setRescoreDocIds
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-