Package org.elasticsearch.action.search
Class SearchShardIterator
java.lang.Object
org.elasticsearch.cluster.routing.PlainShardsIterator
org.elasticsearch.cluster.routing.PlainShardIterator
org.elasticsearch.action.search.SearchShardIterator
- All Implemented Interfaces:
java.lang.Comparable<ShardIterator>,java.lang.Iterable<ShardRouting>,ShardIterator,ShardsIterator
public final class SearchShardIterator extends PlainShardIterator
Extension of
PlainShardIterator used in the search api, which also holds the OriginalIndices
of the search request (useful especially with cross-cluster search, as each cluster has its own set of original indices) as well as
the cluster alias.- See Also:
OriginalIndices
-
Constructor Summary
Constructors Constructor Description SearchShardIterator(java.lang.String clusterAlias, ShardId shardId, java.util.List<ShardRouting> shards, OriginalIndices originalIndices)Creates aPlainShardIteratorinstance that iterates over a subset of the given shards this the a givenshardId. -
Method Summary
Modifier and Type Method Description intcompareTo(ShardIterator o)booleanequals(java.lang.Object o)java.lang.StringgetClusterAlias()Returns the alias of the cluster where the shard is located.OriginalIndicesgetOriginalIndices()Returns the original indices associated with this shard iterator, specifically with the cluster that this shard belongs to.inthashCode()Methods inherited from class org.elasticsearch.cluster.routing.PlainShardsIterator
getShardRoutings, iterator, nextOrNull, remaining, reset, size, sizeActiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.routing.ShardsIterator
getShardRoutings, nextOrNull, remaining, size, sizeActive
-
Constructor Details
-
SearchShardIterator
public SearchShardIterator(@Nullable java.lang.String clusterAlias, ShardId shardId, java.util.List<ShardRouting> shards, OriginalIndices originalIndices)Creates aPlainShardIteratorinstance that iterates over a subset of the given shards this the a givenshardId.- Parameters:
clusterAlias- the alias of the cluster where the shard is locatedshardId- shard id of the groupshards- shards to iterateoriginalIndices- the indices that the search request originally related to (before any rewriting happened)
-
-
Method Details
-
getOriginalIndices
Returns the original indices associated with this shard iterator, specifically with the cluster that this shard belongs to. -
getClusterAlias
Returns the alias of the cluster where the shard is located. -
equals
public boolean equals(java.lang.Object o)- Specified by:
equalsin interfaceShardsIterator- Overrides:
equalsin classPlainShardIterator
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceShardsIterator- Overrides:
hashCodein classPlainShardIterator
-
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<ShardIterator>- Overrides:
compareToin classPlainShardIterator
-