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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, returningtrueif it is competitive.- Throws:
IOException
-
advanceExact
Read the sort value fromdocand returntrueif there is a value for that document. Otherwise returnfalseand 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)trueif the sort value for the doc is "better" than the entry atindex. "Better" in means is "lower" forSortOrder.ASCand "higher" forSortOrder.DESC.
-