public abstract class NumericComparator.NumericLeafComparator extends Object implements LeafFieldComparator
NumericComparator that provides skipping functionality| Modifier and Type | Field and Description |
|---|---|
protected NumericDocValues |
docValues |
| Constructor and Description |
|---|
NumericLeafComparator(LeafReaderContext context) |
| Modifier and Type | Method and Description |
|---|---|
DocIdSetIterator |
competitiveIterator()
Returns a competitive iterator
|
void |
copy(int slot,
int doc)
This method is called when a new hit is competitive.
|
protected abstract void |
encodeBottom(byte[] packedValue) |
protected abstract void |
encodeTop(byte[] packedValue) |
protected NumericDocValues |
getNumericDocValues(LeafReaderContext context,
String field)
Retrieves the NumericDocValues for the field in this segment
|
protected PointValues |
getPointValues(LeafReaderContext context,
String field)
Retrieves point values for the field in this segment
|
protected abstract boolean |
isMissingValueCompetitive() |
void |
setBottom(int slot)
Set the bottom slot, ie the "weakest" (sorted last)
entry in the queue.
|
void |
setHitsThresholdReached()
Informs this leaf comparator that hits threshold is reached.
|
void |
setScorer(Scorable scorer)
Sets the Scorer to use in case a document's score is
needed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareBottom, compareTopprotected final NumericDocValues docValues
public NumericLeafComparator(LeafReaderContext context) throws IOException
IOExceptionprotected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException
If you override this method, you must also override getPointValues(LeafReaderContext, String) This class uses sort optimization that leverages
points to filter out non-competitive matches, which relies on the assumption that points and
doc values record the same information.
context - – reader contextfield - - field nameIOException - If there is a low-level I/O errorprotected PointValues getPointValues(LeafReaderContext context, String field) throws IOException
If you override this method, you must also override getNumericDocValues(LeafReaderContext, String) This class uses sort optimization that
leverages points to filter out non-competitive matches, which relies on the assumption that
points and doc values record the same information. Return null even if no points
implementation is available, in this case sort optimization with points will be disabled.
context - – reader contextfield - - field namenull if
sort optimization with points should be disabled.IOException - If there is a low-level I/O errorpublic void setBottom(int slot)
throws IOException
LeafFieldComparatorLeafFieldComparator.compareBottom(int) is
called, you should compare against this slot. This
will always be called before LeafFieldComparator.compareBottom(int).setBottom in interface LeafFieldComparatorslot - the currently weakest (sorted last) slot in the queueIOExceptionpublic void copy(int slot,
int doc)
throws IOException
LeafFieldComparatorcopy in interface LeafFieldComparatorslot - which slot to copy the hit todoc - docID relative to current readerIOExceptionpublic void setScorer(Scorable scorer) throws IOException
LeafFieldComparatorsetScorer in interface LeafFieldComparatorscorer - Scorer instance that you should use to
obtain the current hit's score, if necessary.IOExceptionpublic void setHitsThresholdReached()
throws IOException
LeafFieldComparatorsetHitsThresholdReached in interface LeafFieldComparatorIOExceptionpublic DocIdSetIterator competitiveIterator()
LeafFieldComparatorcompetitiveIterator in interface LeafFieldComparatornull if such an iterator is not available for the current comparator or segment.protected abstract boolean isMissingValueCompetitive()
protected abstract void encodeBottom(byte[] packedValue)
protected abstract void encodeTop(byte[] packedValue)
Copyright © 2000-2024 Apache Software Foundation. All Rights Reserved.