Package org.apache.lucene.search
Class TermAutomatonScorer
- java.lang.Object
-
- org.apache.lucene.search.Scorable
-
- org.apache.lucene.search.Scorer
-
- org.apache.lucene.search.TermAutomatonScorer
-
class TermAutomatonScorer extends Scorer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
-
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
-
Field Summary
Fields Modifier and Type Field Description private int
anyTermID
private long
cost
private int
docID
private PriorityQueue<TermAutomatonQuery.EnumAndScorer>
docIDQueue
private LeafSimScorer
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 Summary
Constructors Constructor Description TermAutomatonScorer(TermAutomatonQuery.TermAutomatonWeight weight, TermAutomatonQuery.EnumAndScorer[] subs, int anyTermID, java.util.Map<java.lang.Integer,BytesRef> idToTerm, LeafSimScorer docScorer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
countMatches()
int
docID()
Returns the doc ID that is currently being scored.float
getMaxScore(int upTo)
Return the maximum score that documents between the lasttarget
that this iterator wasshallow-advanced
to included andupTo
included.private TermAutomatonScorer.PosState
getPosition(int pos)
DocIdSetIterator
iterator()
Return aDocIdSetIterator
over matching documents.private void
popCurrentDoc()
Pops all enums positioned on the current (minimum) docprivate void
pushCurrentDoc()
Pushes all previously pop'd enums back into the docIDQueuefloat
score()
Returns the score of the current document matching the query.private void
shift(int pos)
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.search.Scorer
advanceShallow, getWeight, twoPhaseIterator
-
Methods inherited from class org.apache.lucene.search.Scorable
getChildren, setMinCompetitiveScore
-
-
-
-
Field Detail
-
subs
private final TermAutomatonQuery.EnumAndScorer[] subs
-
subsOnDoc
private final TermAutomatonQuery.EnumAndScorer[] subsOnDoc
-
docIDQueue
private final PriorityQueue<TermAutomatonQuery.EnumAndScorer> docIDQueue
-
posQueue
private final PriorityQueue<TermAutomatonQuery.EnumAndScorer> posQueue
-
runAutomaton
private final RunAutomaton runAutomaton
-
idToTerm
private final java.util.Map<java.lang.Integer,BytesRef> idToTerm
-
positions
private TermAutomatonScorer.PosState[] positions
-
posShift
int posShift
-
anyTermID
private final int anyTermID
-
docScorer
private final LeafSimScorer docScorer
-
numSubsOnDoc
private int numSubsOnDoc
-
cost
private final long cost
-
docID
private int docID
-
freq
private int freq
-
-
Constructor Detail
-
TermAutomatonScorer
public TermAutomatonScorer(TermAutomatonQuery.TermAutomatonWeight weight, TermAutomatonQuery.EnumAndScorer[] subs, int anyTermID, java.util.Map<java.lang.Integer,BytesRef> idToTerm, LeafSimScorer docScorer) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
popCurrentDoc
private void popCurrentDoc()
Pops all enums positioned on the current (minimum) doc
-
pushCurrentDoc
private void pushCurrentDoc()
Pushes all previously pop'd enums back into the docIDQueue
-
iterator
public DocIdSetIterator iterator()
Description copied from class:Scorer
Return aDocIdSetIterator
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.
-
getPosition
private TermAutomatonScorer.PosState getPosition(int pos)
-
shift
private void shift(int pos)
-
countMatches
private void countMatches() throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
docID
public int docID()
Description copied from class:Scorable
Returns the doc ID that is currently being scored.
-
score
public float score() throws java.io.IOException
Description copied from class:Scorable
Returns the score of the current document matching the query.
-
getMaxScore
public float getMaxScore(int upTo) throws java.io.IOException
Description copied from class:Scorer
Return the maximum score that documents between the lasttarget
that this iterator wasshallow-advanced
to included andupTo
included.- Specified by:
getMaxScore
in classScorer
- Throws:
java.io.IOException
-
-