java.lang.Object
org.apache.lucene.search.Scorable
org.apache.lucene.search.Scorer
org.apache.lucene.search.DisjunctionScorer
- Direct Known Subclasses:
DisjunctionMaxScorer,DisjunctionSumScorer
Base class for Scorers that score disjunctions.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DocIdSetIteratorprivate final booleanprivate final DisiPriorityQueueprivate final DisjunctionScorer.TwoPhase -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDisjunctionScorer(Weight weight, List<Scorer> subScorers, ScoreMode scoreMode) -
Method Summary
Modifier and TypeMethodDescriptionfinal intdocID()Returns the doc ID that is currently being scored.final Collection<Scorable.ChildScorable> Returns child sub-scorers positioned on the current document(package private) DisiWrapperiterator()Return aDocIdSetIteratorover matching documents.final floatscore()Returns the score of the current document matching the query.protected abstract floatscore(DisiWrapper topList) Compute the score for the given linked list of scorers.Optional method: Return aTwoPhaseIteratorview of thisScorer.Methods inherited from class org.apache.lucene.search.Scorer
advanceShallow, getMaxScore, getWeightMethods inherited from class org.apache.lucene.search.Scorable
setMinCompetitiveScore, smoothingScore
-
Field Details
-
needsScores
private final boolean needsScores -
subScorers
-
approximation
-
twoPhase
-
-
Constructor Details
-
DisjunctionScorer
protected DisjunctionScorer(Weight weight, List<Scorer> subScorers, ScoreMode scoreMode) throws IOException - Throws:
IOException
-
-
Method Details
-
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.
-
twoPhaseIterator
Description copied from class:ScorerOptional method: Return aTwoPhaseIteratorview of thisScorer. A return value ofnullindicates that two-phase iteration is not supported.Note that the returned
TwoPhaseIterator'sapproximationmust advance synchronously with theScorer.iterator(): advancing the approximation must advance the iterator and vice-versa.Implementing this method is typically useful on
Scorers that have a high per-document overhead in order to confirm matches.The default implementation returns
null.- Overrides:
twoPhaseIteratorin classScorer
-
docID
public final int docID()Description copied from class:ScorableReturns the doc ID that is currently being scored. -
getSubMatches
- Throws:
IOException
-
score
Description copied from class:ScorableReturns the score of the current document matching the query.- Specified by:
scorein classScorable- Throws:
IOException
-
score
Compute the score for the given linked list of scorers.- Throws:
IOException
-
getChildren
Description copied from class:ScorableReturns child sub-scorers positioned on the current document- Overrides:
getChildrenin classScorable- Throws:
IOException
-