Class ShardDocSortField

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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.apache.lucene.search.SortField

    FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShardDocSortField(int shardRequestIndex, boolean reverse)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    decodeDoc(long value)
    Get the doc id encoded in the sort value.
    static int
    Get the shard request index encoded in the sort value.
    static long
    encodeShardAndDoc(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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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:
      getComparator in class org.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)