java.lang.Object
org.apache.lucene.search.Scorable
org.apache.lucene.search.Scorer
org.apache.lucene.sandbox.search.TermAutomatonScorer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Sorts by docID so we can quickly pull out all scorers that are on the same (lowest) docID.private static class
Sorts by position so we can visit all scorers on one doc, by position.private static class
(package private) static class
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final long
private int
private final PriorityQueue
<TermAutomatonQuery.EnumAndScorer> private int
private final NumericDocValues
private int
private final TermAutomatonQuery.EnumAndScorer[]
originalSubsOnDoc is an array of EnumAndScorer instances used to create this TermAutomatonScorer.private TermAutomatonScorer.PosState[]
private final PriorityQueue
<TermAutomatonQuery.EnumAndScorer> (package private) int
private final RunAutomaton
private final Similarity.SimScorer
private final TermAutomatonQuery.EnumAndScorer[]
-
Constructor Summary
ConstructorsConstructorDescriptionTermAutomatonScorer
(TermAutomatonQuery.TermAutomatonWeight weight, TermAutomatonQuery.EnumAndScorer[] subs, int anyTermID, Similarity.SimScorer scorer, NumericDocValues norms) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
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.(package private) TermAutomatonQuery.EnumAndScorer[]
private TermAutomatonScorer.PosState
getPosition
(int pos) iterator()
Return aDocIdSetIterator
over matching documents.private void
Pops all enums positioned on the current (minimum) docprivate void
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) Methods inherited from class org.apache.lucene.search.Scorer
advanceShallow, twoPhaseIterator
Methods inherited from class org.apache.lucene.search.Scorable
getChildren, setMinCompetitiveScore, smoothingScore
-
Field Details
-
subsOnDoc
-
docIDQueue
-
posQueue
-
runAutomaton
-
positions
-
posShift
int posShift -
anyTermID
private final int anyTermID -
scorer
-
norms
-
numSubsOnDoc
private int numSubsOnDoc -
cost
private final long cost -
docID
private int docID -
freq
private int freq -
originalSubsOnDoc
originalSubsOnDoc is an array of EnumAndScorer instances used to create this TermAutomatonScorer. This field is only for explain purposes and should not be used for scoring/matching.
-
-
Constructor Details
-
TermAutomatonScorer
public TermAutomatonScorer(TermAutomatonQuery.TermAutomatonWeight weight, TermAutomatonQuery.EnumAndScorer[] subs, int anyTermID, Similarity.SimScorer scorer, NumericDocValues norms) throws IOException - Throws:
IOException
-
-
Method Details
-
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
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
-
shift
private void shift(int pos) -
countMatches
- Throws:
IOException
-
getOriginalSubsOnDoc
TermAutomatonQuery.EnumAndScorer[] getOriginalSubsOnDoc() -
docID
public int docID()Description copied from class:Scorer
Returns the doc ID that is currently being scored. -
score
Description copied from class:Scorable
Returns the score of the current document matching the query.- Specified by:
score
in classScorable
- Throws:
IOException
-
getMaxScore
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:
IOException
-