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 classTermAutomatonScorer.DocIDQueueSorts by docID so we can quickly pull out all scorers that are on the same (lowest) docID.private static classTermAutomatonScorer.PositionQueueSorts by position so we can visit all scorers on one doc, by position.private static classTermAutomatonScorer.PosState(package private) static classTermAutomatonScorer.TermRunAutomaton-
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
-
Field Summary
Fields Modifier and Type Field Description private intanyTermIDprivate longcostprivate intdocIDprivate PriorityQueue<TermAutomatonQuery.EnumAndScorer>docIDQueueprivate LeafSimScorerdocScorerprivate intfreqprivate java.util.Map<java.lang.Integer,BytesRef>idToTermprivate intnumSubsOnDocprivate TermAutomatonScorer.PosState[]positionsprivate PriorityQueue<TermAutomatonQuery.EnumAndScorer>posQueue(package private) intposShiftprivate RunAutomatonrunAutomatonprivate TermAutomatonQuery.EnumAndScorer[]subsprivate 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 voidcountMatches()intdocID()Returns the doc ID that is currently being scored.floatgetMaxScore(int upTo)Return the maximum score that documents between the lasttargetthat this iterator wasshallow-advancedto included andupToincluded.private TermAutomatonScorer.PosStategetPosition(int pos)DocIdSetIteratoriterator()Return aDocIdSetIteratorover matching documents.private voidpopCurrentDoc()Pops all enums positioned on the current (minimum) docprivate voidpushCurrentDoc()Pushes all previously pop'd enums back into the docIDQueuefloatscore()Returns the score of the current document matching the query.private voidshift(int pos)java.lang.StringtoString()-
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:ScorerReturn aDocIdSetIteratorover matching documents. The returned iterator will either be positioned on-1if no documents have been scored yet,DocIdSetIterator.NO_MORE_DOCSif 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:
toStringin classjava.lang.Object
-
docID
public int docID()
Description copied from class:ScorableReturns the doc ID that is currently being scored.
-
score
public float score() throws java.io.IOExceptionDescription copied from class:ScorableReturns the score of the current document matching the query.
-
getMaxScore
public float getMaxScore(int upTo) throws java.io.IOExceptionDescription copied from class:ScorerReturn the maximum score that documents between the lasttargetthat this iterator wasshallow-advancedto included andupToincluded.- Specified by:
getMaxScorein classScorer- Throws:
java.io.IOException
-
-