Package org.opensearch.action.search
Class SearchShardIterator
java.lang.Object
org.opensearch.action.search.SearchShardIterator
- All Implemented Interfaces:
Comparable<SearchShardIterator>
,Countable
@PublicApi(since="1.0.0")
public final class SearchShardIterator
extends Object
implements Comparable<SearchShardIterator>, Countable
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:
- Opensearch.api:
-
Constructor Summary
ConstructorsConstructorDescriptionSearchShardIterator
(String clusterAlias, org.opensearch.core.index.shard.ShardId shardId, List<String> targetNodeIds, OriginalIndices originalIndices, ShardSearchContextId searchContextId, org.opensearch.common.unit.TimeValue searchContextKeepAlive) SearchShardIterator
(String clusterAlias, org.opensearch.core.index.shard.ShardId shardId, List<ShardRouting> shards, OriginalIndices originalIndices) Creates aPlainShardIterator
instance that iterates over a subset of the given shards this the a givenshardId
. -
Method Summary
-
Constructor Details
-
SearchShardIterator
public SearchShardIterator(@Nullable String clusterAlias, org.opensearch.core.index.shard.ShardId shardId, List<ShardRouting> shards, OriginalIndices originalIndices) Creates aPlainShardIterator
instance 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)
-
SearchShardIterator
public SearchShardIterator(@Nullable String clusterAlias, org.opensearch.core.index.shard.ShardId shardId, List<String> targetNodeIds, OriginalIndices originalIndices, ShardSearchContextId searchContextId, org.opensearch.common.unit.TimeValue searchContextKeepAlive)
-
-
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. -
nextOrNull
-
size
public int size() -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<SearchShardIterator>
-