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
Performs the actual collection against a LeafReaderContext.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.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
Collect this doc, returningtrue
if it is competitive.- Throws:
IOException
-
advanceExact
Read the sort value fromdoc
and returntrue
if there is a value for that document. Otherwise returnfalse
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 atindex
. "Better" in means is "lower" forSortOrder.ASC
and "higher" forSortOrder.DESC
.
-