final class MultiLeafFieldComparator extends java.lang.Object implements LeafFieldComparator
Modifier and Type | Field and Description |
---|---|
private LeafFieldComparator[] |
comparators |
private LeafFieldComparator |
firstComparator |
private int |
firstReverseMul |
private int[] |
reverseMul |
Constructor and Description |
---|
MultiLeafFieldComparator(LeafFieldComparator[] comparators,
int[] reverseMul) |
Modifier and Type | Method and Description |
---|---|
int |
compareBottom(int doc)
Compare the bottom of the queue with this doc.
|
int |
compareTop(int doc)
Compare the top value with this doc.
|
void |
copy(int slot,
int doc)
This method is called when a new hit is competitive.
|
void |
setBottom(int slot)
Set the bottom slot, ie the "weakest" (sorted last)
entry in the queue.
|
void |
setScorer(Scorable scorer)
Sets the Scorer to use in case a document's score is
needed.
|
private final LeafFieldComparator[] comparators
private final int[] reverseMul
private final LeafFieldComparator firstComparator
private final int firstReverseMul
MultiLeafFieldComparator(LeafFieldComparator[] comparators, int[] reverseMul)
public void setBottom(int slot) throws java.io.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 queuejava.io.IOException
public int compareBottom(int doc) throws java.io.IOException
LeafFieldComparator
FieldComparator.compare(int,int)
} as if bottom were slot1 and the new
document were slot 2.
For a search that hits many results, this method will be the hotspot (invoked by far the most frequently).
compareBottom
in interface LeafFieldComparator
doc
- that was hitN < 0
if the doc's value is sorted after
the bottom entry (not competitive), any N > 0
if the
doc's value is sorted before the bottom entry and 0
if
they are equal.java.io.IOException
public int compareTop(int doc) throws java.io.IOException
LeafFieldComparator
FieldComparator.compare(int,int)
} as if topValue were slot1 and the new
document were slot 2. This is only called for searches that
use searchAfter (deep paging).compareTop
in interface LeafFieldComparator
doc
- that was hitN < 0
if the doc's value is sorted after
the top entry (not competitive), any N > 0
if the
doc's value is sorted before the top entry and 0
if
they are equal.java.io.IOException
public void copy(int slot, int doc) throws java.io.IOException
LeafFieldComparator
copy
in interface LeafFieldComparator
slot
- which slot to copy the hit todoc
- docID relative to current readerjava.io.IOException
public void setScorer(Scorable scorer) throws java.io.IOException
LeafFieldComparator
setScorer
in interface LeafFieldComparator
scorer
- Scorer instance that you should use to
obtain the current hit's score, if necessary.java.io.IOException