java.lang.Object
org.apache.lucene.search.SortField
org.elasticsearch.search.sort.ShardDocSortField
public class ShardDocSortField
extends org.apache.lucene.search.SortField
A
SortField that first compares the shard index and then uses the document number (_doc)
to tiebreak if the value is the same.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.SortField
org.apache.lucene.search.SortField.Provider, org.apache.lucene.search.SortField.Type -
Field Summary
FieldsFields inherited from class org.apache.lucene.search.SortField
FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intdecodeDoc(long value) Get the doc id encoded in the sort value.static intdecodeShardRequestIndex(long value) Get the shard request index encoded in the sort value.static longencodeShardAndDoc(int shardIndex, int doc) org.apache.lucene.search.FieldComparator<?> getComparator(int numHits, org.apache.lucene.search.Pruning enableSkipping) Methods inherited from class org.apache.lucene.search.SortField
equals, getBytesComparator, getComparatorSource, getField, getIndexSorter, getMissingValue, getOptimizeSortWithIndexedData, getOptimizeSortWithPoints, getReverse, getType, hashCode, needsScores, readType, rewrite, setBytesComparator, setMissingValue, setOptimizeSortWithIndexedData, setOptimizeSortWithPoints, toString
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ShardDocSortField
public ShardDocSortField(int shardRequestIndex, boolean reverse)
-
-
Method Details
-
getComparator
public org.apache.lucene.search.FieldComparator<?> getComparator(int numHits, org.apache.lucene.search.Pruning enableSkipping) - Overrides:
getComparatorin classorg.apache.lucene.search.SortField
-
decodeDoc
public static int decodeDoc(long value) Get the doc id encoded in the sort value. -
decodeShardRequestIndex
public static int decodeShardRequestIndex(long value) Get the shard request index encoded in the sort value. -
encodeShardAndDoc
public static long encodeShardAndDoc(int shardIndex, int doc)
-