Class ShardSearchRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.search.internal.ShardSearchRequest
- All Implemented Interfaces:
IndicesRequest,Writeable,org.elasticsearch.core.RefCounted,TaskAwareRequest
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
ConstructorsConstructorDescriptionShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int shardRequestIndex, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, String clusterAlias)ShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int shardRequestIndex, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, String clusterAlias, ShardSearchContextId readerId, org.elasticsearch.core.TimeValue keepAlive)ShardSearchRequest(ShardId shardId, String[] types, long nowInMillis, AliasFilter aliasFilter) -
Method Summary
Modifier and TypeMethodDescriptionbooleancacheKey(CheckedBiConsumer<ShardSearchRequest,StreamOutput,IOException> differentiator)Returns the cache key for this shard search request, based on its contentbooleanReturns true if the caller can handle null responseQuerySearchResult.nullInstance().voidcanReturnNullResponseIfMatchNoDocs(boolean value)Returns the task object that should be used to keep track of the processing of the request.Returns the minimum version of the channel that the request has been passed.Returns optional description of the request to be displayed by the task managerfloatString[]indices()Returns the array of indices that the action relates toReturns the indices options used to resolve indices.protected voidinnerWriteTo(StreamOutput out, boolean asKey)org.elasticsearch.core.TimeValueReturns a non-null to specify the time to live of the point-in-time reader that is used to execute this request.longintstatic QueryBuilderparseAliasFilter(org.elasticsearch.core.CheckedFunction<BytesReference,QueryBuilder,IOException> filterParser, IndexMetadata metadata, String... aliasNames)Returns the filter associated with listed filtering aliases.readerId()Returns a non-null value if this request should execute using a specific point-in-time reader; otherwise, using the most up to date point-in-time reader.voidrequestCache(Boolean requestCache)scroll()voidsetAliasFilter(AliasFilter aliasFilter)voidSets the bottom sort values that can be used by the searcher to filter documents that are after it.shardId()intReturns the shard request ordinal that is used by the main search request to reference this shard.source()voidsource(SearchSourceBuilder source)String[]types()voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.IndicesRequest
allowsRemoteIndices, includeDataStreamsMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
setParentTask
-
Constructor Details
-
ShardSearchRequest
public ShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int shardRequestIndex, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, @Nullable String clusterAlias) -
ShardSearchRequest
public ShardSearchRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int shardRequestIndex, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, @Nullable String clusterAlias, ShardSearchContextId readerId, org.elasticsearch.core.TimeValue keepAlive) -
ShardSearchRequest
public ShardSearchRequest(ShardId shardId, String[] types, long nowInMillis, AliasFilter aliasFilter) -
ShardSearchRequest
- Throws:
IOException
-
ShardSearchRequest
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classTransportRequest- Throws:
IOException
-
innerWriteTo
- Throws:
IOException
-
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
-
source
-
getAliasFilter
-
setAliasFilter
-
source
-
shardRequestIndex
public int shardRequestIndex()Returns the shard request ordinal that is used by the main search request to reference this shard. -
numberOfShards
public int numberOfShards() -
searchType
-
indexBoost
public float indexBoost() -
nowInMillis
public long nowInMillis() -
requestCache
-
requestCache
-
allowPartialSearchResults
public boolean allowPartialSearchResults() -
scroll
-
setBottomSortValues
Sets the bottom sort values that can be used by the searcher to filter documents that are after it. This value is computed by coordinating nodes that throttles the query phase. After a partial merge of successful shards the sort values of the bottom top document are passed as an hint on subsequent shard requests. -
getBottomSortValues
-
canReturnNullResponseIfMatchNoDocs
public boolean canReturnNullResponseIfMatchNoDocs()Returns true if the caller can handle null responseQuerySearchResult.nullInstance(). Defaults to false since the coordinator node needs at least one shard response to build the global response. -
canReturnNullResponseIfMatchNoDocs
public void canReturnNullResponseIfMatchNoDocs(boolean value) -
readerId
Returns a non-null value if this request should execute using a specific point-in-time reader; otherwise, using the most up to date point-in-time reader. -
keepAlive
public org.elasticsearch.core.TimeValue keepAlive()Returns a non-null to specify the time to live of the point-in-time reader that is used to execute this request. -
cacheKey
public BytesReference cacheKey(CheckedBiConsumer<ShardSearchRequest,StreamOutput,IOException> differentiator) throws IOExceptionReturns the cache key for this shard search request, based on its content- Throws:
IOException
-
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
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(org.elasticsearch.core.CheckedFunction<BytesReference,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. -
getRuntimeMappings
-
getChannelVersion
Returns the minimum version of the channel that the request has been passed. If the request never passes around, then the channel version isVersion.CURRENT; otherwise, it's the minimum version of the coordinating node and data node (and the proxy node in case the request is sent to the proxy node of the remote cluster before reaching the data node).
-