class TermAutomatonScorer extends Scorer
Modifier and Type | Class and Description |
---|---|
private static class |
TermAutomatonScorer.DocIDQueue
Sorts by docID so we can quickly pull out all scorers that are on
the same (lowest) docID.
|
private static class |
TermAutomatonScorer.PositionQueue
Sorts by position so we can visit all scorers on one doc, by
position.
|
private static class |
TermAutomatonScorer.PosState |
(package private) static class |
TermAutomatonScorer.TermRunAutomaton |
Scorer.ChildScorer
Modifier and Type | Field and Description |
---|---|
private int |
anyTermID |
private long |
cost |
private int |
docID |
private PriorityQueue<TermAutomatonQuery.EnumAndScorer> |
docIDQueue |
private Similarity.SimScorer |
docScorer |
private int |
freq |
private java.util.Map<java.lang.Integer,BytesRef> |
idToTerm |
private int |
numSubsOnDoc |
private TermAutomatonScorer.PosState[] |
positions |
private PriorityQueue<TermAutomatonQuery.EnumAndScorer> |
posQueue |
(package private) int |
posShift |
private RunAutomaton |
runAutomaton |
private TermAutomatonQuery.EnumAndScorer[] |
subs |
private TermAutomatonQuery.EnumAndScorer[] |
subsOnDoc |
Constructor and Description |
---|
TermAutomatonScorer(TermAutomatonQuery.TermAutomatonWeight weight,
TermAutomatonQuery.EnumAndScorer[] subs,
int anyTermID,
java.util.Map<java.lang.Integer,BytesRef> idToTerm,
Similarity.SimScorer docScorer) |
Modifier and Type | Method and Description |
---|---|
private void |
countMatches() |
int |
docID()
Returns the doc ID that is currently being scored.
|
int |
freq()
Returns the freq of this Scorer on the current document
|
private TermAutomatonScorer.PosState |
getPosition(int pos) |
DocIdSetIterator |
iterator()
Return a
DocIdSetIterator over matching documents. |
private void |
popCurrentDoc()
Pops all enums positioned on the current (minimum) doc
|
private void |
pushCurrentDoc()
Pushes all previously pop'd enums back into the docIDQueue
|
float |
score()
Returns the score of the current document matching the query.
|
private void |
shift(int pos) |
java.lang.String |
toString() |
getChildren, getWeight, twoPhaseIterator
private final TermAutomatonQuery.EnumAndScorer[] subs
private final TermAutomatonQuery.EnumAndScorer[] subsOnDoc
private final PriorityQueue<TermAutomatonQuery.EnumAndScorer> docIDQueue
private final PriorityQueue<TermAutomatonQuery.EnumAndScorer> posQueue
private final RunAutomaton runAutomaton
private final java.util.Map<java.lang.Integer,BytesRef> idToTerm
private TermAutomatonScorer.PosState[] positions
int posShift
private final int anyTermID
private final Similarity.SimScorer docScorer
private int numSubsOnDoc
private final long cost
private int docID
private int freq
public TermAutomatonScorer(TermAutomatonQuery.TermAutomatonWeight weight, TermAutomatonQuery.EnumAndScorer[] subs, int anyTermID, java.util.Map<java.lang.Integer,BytesRef> idToTerm, Similarity.SimScorer docScorer) throws java.io.IOException
java.io.IOException
private void popCurrentDoc()
private void pushCurrentDoc()
public DocIdSetIterator iterator()
Scorer
DocIdSetIterator
over matching documents.
The returned iterator will either be positioned on -1
if no
documents have been scored yet, DocIdSetIterator.NO_MORE_DOCS
if all documents have been scored already, or the last document id that
has been scored otherwise.
The returned iterator is a view: calling this method several times will
return iterators that have the same state.private TermAutomatonScorer.PosState getPosition(int pos)
private void shift(int pos)
private void countMatches() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int freq()
Scorer
public int docID()
Scorer
-1
if the Scorer.iterator()
is not positioned
or DocIdSetIterator.NO_MORE_DOCS
if it has been entirely consumed.docID
in class Scorer
DocIdSetIterator.docID()
public float score() throws java.io.IOException
Scorer
DocIdSetIterator.nextDoc()
or
DocIdSetIterator.advance(int)
is called on the Scorer.iterator()
the first time, or when called from within LeafCollector.collect(int)
.