Class BucketedSort.Leaf

java.lang.Object
org.elasticsearch.search.sort.BucketedSort.Leaf
All Implemented Interfaces:
ScorerAware
Direct Known Subclasses:
BucketedSort.ForDoubles.Leaf, BucketedSort.ForFloats.Leaf, BucketedSort.ForLongs.Leaf
Enclosing class:
BucketedSort

public abstract class BucketedSort.Leaf extends Object implements ScorerAware
Performs the actual collection against a LeafReaderContext.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Leaf(org.apache.lucene.index.LeafReaderContext ctx)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract boolean
    advanceExact(int doc)
    Read the sort value from doc and return true if there is a value for that document.
    void
    collect(int doc, long bucket)
    Collect this doc, returning true if it is competitive.
    protected abstract boolean
    docBetterThan(long index)
    true if the sort value for the doc is "better" than the entry at index.
    protected abstract void
    setIndexToDocValue(long index)
    Set the value at the index to the value of the document to which we just advanced.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.lucene.ScorerAware

    setScorer
  • Constructor Details

    • Leaf

      protected Leaf(org.apache.lucene.index.LeafReaderContext ctx)
  • Method Details

    • collect

      public final void collect(int doc, long bucket) throws IOException
      Collect this doc, returning true if it is competitive.
      Throws:
      IOException
    • advanceExact

      protected abstract boolean advanceExact(int doc) throws IOException
      Read the sort value from doc and return true if there is a value for that document. Otherwise return false and the sort will skip that document.
      Throws:
      IOException
    • setIndexToDocValue

      protected abstract void setIndexToDocValue(long index)
      Set the value at the index to the value of the document to which we just advanced.
    • docBetterThan

      protected abstract boolean docBetterThan(long index)
      true if the sort value for the doc is "better" than the entry at index. "Better" in means is "lower" for SortOrder.ASC and "higher" for SortOrder.DESC.