Class ShardSearchRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.search.internal.ShardSearchRequest
-
- All Implemented Interfaces:
IndicesRequest,Writeable,TaskAwareRequest
public class ShardSearchRequest extends TransportRequest implements IndicesRequest
Shard level request that represents a search. It provides all the methods that theSearchContextneeds. Provides a cache key based on its content that can be used to cache shard level response.
-
-
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 ShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, java.lang.String clusterAlias, java.lang.String[] indexRoutings)ShardSearchRequest(StreamInput in)ShardSearchRequest(ShardId shardId, java.lang.String[] types, long nowInMillis, AliasFilter aliasFilter)
-
Method Summary
Modifier and Type Method Description booleanallowPartialSearchResults()BytesReferencecacheKey()Returns the cache key for this shard search request, based on its contentTaskcreateTask(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.AliasFiltergetAliasFilter()java.lang.StringgetClusterAlias()java.lang.StringgetDescription()Returns optional description of the request to be displayed by the task managerRewriteable<Rewriteable>getRewriteable()floatindexBoost()java.lang.String[]indexRoutings()java.lang.String[]indices()Returns the array of indices that the action relates toIndicesOptionsindicesOptions()Returns the indices options used to resolve indices.protected voidinnerWriteTo(StreamOutput out, boolean asKey)longnowInMillis()intnumberOfShards()static QueryBuilderparseAliasFilter(CheckedFunction<byte[],QueryBuilder,java.io.IOException> filterParser, IndexMetaData metaData, java.lang.String... aliasNames)Returns the filter associated with listed filtering aliases.java.lang.Stringpreference()java.lang.BooleanrequestCache()Scrollscroll()SearchTypesearchType()voidsetAliasFilter(AliasFilter aliasFilter)ShardIdshardId()SearchSourceBuildersource()voidsource(SearchSourceBuilder source)java.lang.String[]types()voidwriteTo(StreamOutput out)Write this into the 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
-
ShardSearchRequest
public ShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, @Nullable java.lang.String clusterAlias, java.lang.String[] indexRoutings)
-
ShardSearchRequest
public ShardSearchRequest(ShardId shardId, java.lang.String[] types, long nowInMillis, AliasFilter aliasFilter)
-
ShardSearchRequest
public ShardSearchRequest(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classTransportRequest- Throws:
java.io.IOException
-
innerWriteTo
protected final void innerWriteTo(StreamOutput out, boolean asKey) throws java.io.IOException
- Throws:
java.io.IOException
-
indices
public java.lang.String[] indices()
Description copied from interface:IndicesRequestReturns the array of indices that the action relates to- Specified by:
indicesin interfaceIndicesRequest
-
indicesOptions
public IndicesOptions indicesOptions()
Description copied from interface:IndicesRequestReturns 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:
indicesOptionsin interfaceIndicesRequest
-
shardId
public ShardId shardId()
-
types
public java.lang.String[] types()
-
source
public SearchSourceBuilder source()
-
getAliasFilter
public AliasFilter getAliasFilter()
-
setAliasFilter
public void setAliasFilter(AliasFilter aliasFilter)
-
source
public void source(SearchSourceBuilder source)
-
numberOfShards
public int numberOfShards()
-
searchType
public SearchType searchType()
-
indexBoost
public float indexBoost()
-
nowInMillis
public long nowInMillis()
-
requestCache
public java.lang.Boolean requestCache()
-
allowPartialSearchResults
public boolean allowPartialSearchResults()
-
scroll
public Scroll scroll()
-
indexRoutings
public java.lang.String[] indexRoutings()
-
preference
public java.lang.String preference()
-
cacheKey
public BytesReference cacheKey() throws java.io.IOException
Returns the cache key for this shard search request, based on its content- Throws:
java.io.IOException
-
getClusterAlias
public java.lang.String getClusterAlias()
-
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:TaskAwareRequestReturns the task object that should be used to keep track of the processing of the request.- Specified by:
createTaskin interfaceTaskAwareRequest
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TaskAwareRequestReturns optional description of the request to be displayed by the task manager- Specified by:
getDescriptionin interfaceTaskAwareRequest
-
getRewriteable
public Rewriteable<Rewriteable> getRewriteable()
-
parseAliasFilter
public static QueryBuilder parseAliasFilter(CheckedFunction<byte[],QueryBuilder,java.io.IOException> filterParser, IndexMetaData metaData, java.lang.String... aliasNames)
Returns the filter associated with listed filtering aliases.The list of filtering aliases should be obtained by calling MetaData.filteringAliases. Returns
nullif no filtering is required.
-
-