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 the
SearchContext needs.
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.EmptyNested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.ReplaceableNested 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, setParentTaskMethods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Constructor Details
-
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
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classTransportRequest- Throws:
java.io.IOException
-
innerWriteTo
- 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
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
-
types
public java.lang.String[] types() -
source
-
getAliasFilter
-
setAliasFilter
-
source
-
numberOfShards
public int numberOfShards() -
searchType
-
indexBoost
public float indexBoost() -
nowInMillis
public long nowInMillis() -
requestCache
public java.lang.Boolean requestCache() -
allowPartialSearchResults
public boolean allowPartialSearchResults() -
scroll
-
indexRoutings
public java.lang.String[] indexRoutings() -
preference
public java.lang.String preference() -
cacheKey
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
-
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.
-