Class ShardSearchLocalRequest
- java.lang.Object
-
- org.elasticsearch.search.internal.ShardSearchLocalRequest
-
- All Implemented Interfaces:
ShardSearchRequest
public class ShardSearchLocalRequest extends java.lang.Object implements ShardSearchRequest
Shard level search request that gets created and consumed on the local node. Used by warmers and by api that need to create a search context within their execution. Source structure:{ from : 0, size : 20, (optional, can be set on the request) sort : { "name.first" : {}, "name.last" : { reverse : true } } fields : [ "name.first", "name.last" ] query : { ... } aggs : { "agg1" : { terms : { ... } } } }
-
-
Constructor Summary
Constructors Constructor Description ShardSearchLocalRequest(ShardId shardId, int numberOfShards, SearchType searchType, SearchSourceBuilder source, java.lang.String[] types, java.lang.Boolean requestCache, AliasFilter aliasFilter, float indexBoost, boolean allowPartialSearchResults, java.lang.String[] indexRoutings, java.lang.String preference)
ShardSearchLocalRequest(ShardId shardId, java.lang.String[] types, long nowInMillis, AliasFilter aliasFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
allowPartialSearchResults()
BytesReference
cacheKey()
Returns the cache key for this shard search request, based on its contentAliasFilter
getAliasFilter()
java.lang.String
getClusterAlias()
Returns the cluster alias if this request is for a remote cluster ornull
if the request if targeted to the local cluster.Rewriteable<Rewriteable>
getRewriteable()
float
indexBoost()
java.lang.String[]
indexRoutings()
Returns the routing values resolved by the coordinating node for the index pointed byShardSearchRequest.shardId()
.protected void
innerReadFrom(StreamInput in)
protected void
innerWriteTo(StreamOutput out, boolean asKey)
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()
.java.lang.Boolean
requestCache()
Scroll
scroll()
SearchType
searchType()
void
setAliasFilter(AliasFilter aliasFilter)
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()
-
-
-
Constructor Detail
-
ShardSearchLocalRequest
public ShardSearchLocalRequest(ShardId shardId, java.lang.String[] types, long nowInMillis, AliasFilter aliasFilter)
-
ShardSearchLocalRequest
public ShardSearchLocalRequest(ShardId shardId, int numberOfShards, SearchType searchType, SearchSourceBuilder source, java.lang.String[] types, java.lang.Boolean requestCache, AliasFilter aliasFilter, float indexBoost, boolean allowPartialSearchResults, java.lang.String[] indexRoutings, java.lang.String preference)
-
-
Method Detail
-
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 aliasFilter)
- 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
-
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
-
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
-
innerReadFrom
protected void innerReadFrom(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
innerWriteTo
protected void innerWriteTo(StreamOutput out, boolean asKey) throws java.io.IOException
- 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
-
getClusterAlias
public java.lang.String getClusterAlias()
Description copied from interface:ShardSearchRequest
Returns the cluster alias if this request is for a remote cluster ornull
if the request if targeted to the local cluster.- Specified by:
getClusterAlias
in interfaceShardSearchRequest
-
getRewriteable
public Rewriteable<Rewriteable> getRewriteable()
- Specified by:
getRewriteable
in interfaceShardSearchRequest
-
-