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 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 fromdoc
and returntrue
if there is a value for that document.void
collect(int doc, long bucket)
Collect this doc, returningtrue
if it is competitive.protected abstract boolean
docBetterThan(long index)
true
if the sort value for the doc is "better" than the entry atindex
.protected abstract void
setIndexToDocValue(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, returningtrue
if it is competitive.- Throws:
java.io.IOException
-
advanceExact
protected abstract boolean advanceExact(int doc) throws java.io.IOExceptionRead the sort value fromdoc
and returntrue
if there is a value for that document. Otherwise returnfalse
and 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)true
if the sort value for the doc is "better" than the entry atindex
. "Better" in means is "lower" forSortOrder.ASC
and "higher" forSortOrder.DESC
.
-