Package org.elasticsearch.search
Class SearchPhaseResult
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportResponse
-
- org.elasticsearch.search.SearchPhaseResult
-
- All Implemented Interfaces:
Streamable
,Writeable
- Direct Known Subclasses:
DfsSearchResult
,FetchSearchResult
,QueryFetchSearchResult
,QuerySearchResult
,ScrollQueryFetchSearchResult
,ScrollQuerySearchResult
,SearchService.CanMatchResponse
public abstract class SearchPhaseResult extends TransportResponse implements Streamable
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 class org.elasticsearch.transport.TransportResponse
TransportResponse.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected long
requestId
-
Constructor Summary
Constructors Constructor Description SearchPhaseResult()
-
Method Summary
Modifier and Type Method Description FetchSearchResult
fetchResult()
Returns the fetch result iff it's included in this response otherwisenull
long
getRequestId()
Returns the results request ID that is used to reference the search context on the executing nodeSearchShardTarget
getSearchShardTarget()
int
getShardIndex()
Returns the shard index in the context of the currently executing search request that is used for accounting on the coordinating nodeQuerySearchResult
queryResult()
Returns the query result iff it's included in this response otherwisenull
void
setSearchShardTarget(SearchShardTarget shardTarget)
void
setShardIndex(int shardIndex)
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
readFrom, remoteAddress, remoteAddress, writeTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
readFrom, writeTo
-
-
-
-
Method Detail
-
getRequestId
public long getRequestId()
Returns the results request ID that is used to reference the search context on the executing node
-
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
public SearchShardTarget getSearchShardTarget()
-
setSearchShardTarget
public void setSearchShardTarget(SearchShardTarget shardTarget)
-
setShardIndex
public void setShardIndex(int shardIndex)
-
queryResult
public QuerySearchResult queryResult()
Returns the query result iff it's included in this response otherwisenull
-
fetchResult
public FetchSearchResult fetchResult()
Returns the fetch result iff it's included in this response otherwisenull
-
-