public abstract class NumericComparator.NumericLeafComparator extends Object implements LeafFieldComparator
NumericComparator
that provides skipping functionalityModifier 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, wait
compareBottom, compareTop
protected final NumericDocValues docValues
public NumericLeafComparator(LeafReaderContext context) throws IOException
IOException
protected 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
LeafFieldComparator
LeafFieldComparator.compareBottom(int)
is
called, you should compare against this slot. This
will always be called before LeafFieldComparator.compareBottom(int)
.setBottom
in interface LeafFieldComparator
slot
- the currently weakest (sorted last) slot in the queueIOException
public void copy(int slot, int doc) throws IOException
LeafFieldComparator
copy
in interface LeafFieldComparator
slot
- which slot to copy the hit todoc
- docID relative to current readerIOException
public void setScorer(Scorable scorer) throws IOException
LeafFieldComparator
setScorer
in interface LeafFieldComparator
scorer
- Scorer instance that you should use to
obtain the current hit's score, if necessary.IOException
public void setHitsThresholdReached() throws IOException
LeafFieldComparator
setHitsThresholdReached
in interface LeafFieldComparator
IOException
public DocIdSetIterator competitiveIterator()
LeafFieldComparator
competitiveIterator
in interface LeafFieldComparator
null
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.