Class ShardSearchTransportRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.search.internal.ShardSearchTransportRequest
-
- All Implemented Interfaces:
IndicesRequest
,Streamable
,Writeable
,ShardSearchRequest
,TaskAwareRequest
public class ShardSearchTransportRequest extends TransportRequest implements ShardSearchRequest, IndicesRequest
Shard level search request that represents an actual search sent from the coordinating node to the nodes holding the shards where the query needs to be executed. Holds the same info asShardSearchLocalRequest
but gets sent over the transport and holds also the indices coming from the original request that generated it, plus its headers and context.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Constructor Summary
Constructors Constructor Description ShardSearchTransportRequest()
ShardSearchTransportRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, java.lang.String clusterAlias, java.lang.String[] indexRoutings)
-
Method Summary
Modifier and Type Method Description java.lang.Boolean
allowPartialSearchResults()
BytesReference
cacheKey()
Returns the cache key for this shard search request, based on its contentTask
createTask(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
Returns the task object that should be used to keep track of the processing of the request.AliasFilter
getAliasFilter()
java.lang.String
getClusterAlias()
Returns the cluster alias in case the request is part of a cross-cluster search request,null
otherwise.java.lang.String
getDescription()
Returns optional description of the request to be displayed by the task managerRewriteable<Rewriteable>
getRewriteable()
float
indexBoost()
java.lang.String[]
indexRoutings()
Returns the routing values resolved by the coordinating node for the index pointed byShardSearchRequest.shardId()
.java.lang.String[]
indices()
Returns the array of indices that the action relates toIndicesOptions
indicesOptions()
Returns the indices options used to resolve indices.boolean
isProfile()
Returns true if this shard search is being profiled or notlong
nowInMillis()
int
numberOfShards()
java.lang.String
preference()
Returns the preference of the originalSearchRequest.preference()
.void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.java.lang.Boolean
requestCache()
void
requestCache(java.lang.Boolean requestCache)
Scroll
scroll()
SearchType
searchType()
void
searchType(SearchType searchType)
void
setAliasFilter(AliasFilter filter)
void
setProfile(boolean profile)
Sets if this shard search needs to be profiled or notShardId
shardId()
SearchSourceBuilder
source()
void
source(SearchSourceBuilder source)
java.lang.String[]
types()
void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
setParentTask
-
-
-
-
Constructor Detail
-
ShardSearchTransportRequest
public ShardSearchTransportRequest()
-
ShardSearchTransportRequest
public ShardSearchTransportRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, @Nullable java.lang.String clusterAlias, java.lang.String[] indexRoutings)
-
-
Method Detail
-
searchType
public void searchType(SearchType searchType)
-
indices
public java.lang.String[] indices()
Description copied from interface:IndicesRequest
Returns the array of indices that the action relates to- Specified by:
indices
in interfaceIndicesRequest
-
indicesOptions
public IndicesOptions indicesOptions()
Description copied from interface:IndicesRequest
Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.- Specified by:
indicesOptions
in interfaceIndicesRequest
-
shardId
public ShardId shardId()
- Specified by:
shardId
in interfaceShardSearchRequest
-
types
public java.lang.String[] types()
- Specified by:
types
in interfaceShardSearchRequest
-
source
public SearchSourceBuilder source()
- Specified by:
source
in interfaceShardSearchRequest
-
getAliasFilter
public AliasFilter getAliasFilter()
- Specified by:
getAliasFilter
in interfaceShardSearchRequest
-
setAliasFilter
public void setAliasFilter(AliasFilter filter)
- Specified by:
setAliasFilter
in interfaceShardSearchRequest
-
source
public void source(SearchSourceBuilder source)
- Specified by:
source
in interfaceShardSearchRequest
-
numberOfShards
public int numberOfShards()
- Specified by:
numberOfShards
in interfaceShardSearchRequest
-
searchType
public SearchType searchType()
- Specified by:
searchType
in interfaceShardSearchRequest
-
indexBoost
public float indexBoost()
- Specified by:
indexBoost
in interfaceShardSearchRequest
-
nowInMillis
public long nowInMillis()
- Specified by:
nowInMillis
in interfaceShardSearchRequest
-
requestCache
public java.lang.Boolean requestCache()
- Specified by:
requestCache
in interfaceShardSearchRequest
-
requestCache
public void requestCache(java.lang.Boolean requestCache)
- Specified by:
requestCache
in interfaceShardSearchRequest
-
allowPartialSearchResults
public java.lang.Boolean allowPartialSearchResults()
- Specified by:
allowPartialSearchResults
in interfaceShardSearchRequest
-
scroll
public Scroll scroll()
- Specified by:
scroll
in interfaceShardSearchRequest
-
indexRoutings
public java.lang.String[] indexRoutings()
Description copied from interface:ShardSearchRequest
Returns the routing values resolved by the coordinating node for the index pointed byShardSearchRequest.shardId()
.- Specified by:
indexRoutings
in interfaceShardSearchRequest
-
preference
public java.lang.String preference()
Description copied from interface:ShardSearchRequest
Returns the preference of the originalSearchRequest.preference()
.- Specified by:
preference
in interfaceShardSearchRequest
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classTransportRequest
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classTransportRequest
- Throws:
java.io.IOException
-
cacheKey
public BytesReference cacheKey() throws java.io.IOException
Description copied from interface:ShardSearchRequest
Returns the cache key for this shard search request, based on its content- Specified by:
cacheKey
in interfaceShardSearchRequest
- Throws:
java.io.IOException
-
setProfile
public void setProfile(boolean profile)
Description copied from interface:ShardSearchRequest
Sets if this shard search needs to be profiled or not- Specified by:
setProfile
in interfaceShardSearchRequest
- Parameters:
profile
- True if the shard should be profiled
-
isProfile
public boolean isProfile()
Description copied from interface:ShardSearchRequest
Returns true if this shard search is being profiled or not- Specified by:
isProfile
in interfaceShardSearchRequest
-
createTask
public Task createTask(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
Description copied from interface:TaskAwareRequest
Returns the task object that should be used to keep track of the processing of the request. A request can override this method and return null to avoid being tracked by the task manager.- Specified by:
createTask
in interfaceTaskAwareRequest
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager- Specified by:
getDescription
in interfaceTaskAwareRequest
-
getClusterAlias
public java.lang.String getClusterAlias()
Description copied from interface:ShardSearchRequest
Returns the cluster alias in case the request is part of a cross-cluster search request,null
otherwise.- Specified by:
getClusterAlias
in interfaceShardSearchRequest
-
getRewriteable
public Rewriteable<Rewriteable> getRewriteable()
- Specified by:
getRewriteable
in interfaceShardSearchRequest
-
-