Package org.elasticsearch.search.sort
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 java.lang.Object implements ScorerAware
Performs the actual collection against a LeafReaderContext.
-
Constructor Summary
Constructors Modifier Constructor Description protectedLeaf(org.apache.lucene.index.LeafReaderContext ctx) -
Method Summary
Modifier and Type Method Description protected abstract booleanadvanceExact(int doc)Read the sort value fromdocand returntrueif there is a value for that document.voidcollect(int doc, long bucket)Collect this doc, returningtrueif it is competitive.protected abstract booleandocBetterThan(long index)trueif the sort value for the doc is "better" than the entry atindex.protected abstract voidsetIndexToDocValue(long index)Set the value at the index to the value of the document to which we just advanced.
-
Constructor Details
-
Leaf
protected Leaf(org.apache.lucene.index.LeafReaderContext ctx)
-
-
Method Details
-
collect
public final void collect(int doc, long bucket) throws java.io.IOExceptionCollect this doc, returningtrueif it is competitive.- Throws:
java.io.IOException
-
advanceExact
protected abstract boolean advanceExact(int doc) throws java.io.IOExceptionRead the sort value fromdocand returntrueif there is a value for that document. Otherwise returnfalseand the sort will skip that document.- Throws:
java.io.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)trueif the sort value for the doc is "better" than the entry atindex. "Better" in means is "lower" forSortOrder.ASCand "higher" forSortOrder.DESC.
-