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, String clusterAlias, String[] indexRoutings)ShardSearchRequest(StreamInput in)ShardSearchRequest(ShardId shardId, String[] types, long nowInMillis, AliasFilter aliasFilter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowPartialSearchResults()BytesReferencecacheKey()Returns the cache key for this shard search request, based on its contentTaskcreateTask(long id, String type, String action, TaskId parentTaskId, Map<String,String> headers)Returns the task object that should be used to keep track of the processing of the request.AliasFiltergetAliasFilter()StringgetClusterAlias()StringgetDescription()Returns optional description of the request to be displayed by the task managerRewriteable<Rewriteable>getRewriteable()floatindexBoost()String[]indexRoutings()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,IOException> filterParser, IndexMetaData metaData, String... aliasNames)Returns the filter associated with listed filtering aliases.Stringpreference()BooleanrequestCache()Scrollscroll()SearchTypesearchType()voidsetAliasFilter(AliasFilter aliasFilter)ShardIdshardId()SearchSourceBuildersource()voidsource(SearchSourceBuilder source)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 String clusterAlias, String[] indexRoutings)
-
ShardSearchRequest
public ShardSearchRequest(ShardId shardId, String[] types, long nowInMillis, AliasFilter aliasFilter)
-
ShardSearchRequest
public ShardSearchRequest(StreamInput in) throws IOException
- Throws:
IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classTransportRequest- Throws:
IOException
-
innerWriteTo
protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOException
- Throws:
IOException
-
indices
public 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 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 Boolean requestCache()
-
allowPartialSearchResults
public boolean allowPartialSearchResults()
-
scroll
public Scroll scroll()
-
indexRoutings
public String[] indexRoutings()
-
preference
public String preference()
-
cacheKey
public BytesReference cacheKey() throws IOException
Returns the cache key for this shard search request, based on its content- Throws:
IOException
-
getClusterAlias
public String getClusterAlias()
-
createTask
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String,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 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,IOException> filterParser, IndexMetaData metaData, 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.
-
-