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 DocIdSetIterator
private final BlockMaxDISI
private final boolean
private final DisiPriorityQueue
private final DisjunctionScorer.TwoPhase
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DisjunctionScorer
(Weight weight, List<Scorer> subScorers, ScoreMode scoreMode) -
Method Summary
Modifier and TypeMethodDescriptionfinal int
docID()
Returns the doc ID that is currently being scored.(package private) BlockMaxDISI
final Collection<Scorable.ChildScorable>
Returns child sub-scorers positioned on the current document(package private) DisiWrapper
iterator()
Return aDocIdSetIterator
over matching documents.final float
score()
Returns the score of the current document matching the query.protected abstract float
score
(DisiWrapper topList) Compute the score for the given linked list of scorers.Optional method: Return aTwoPhaseIterator
view of thisScorer
.Methods inherited from class org.apache.lucene.search.Scorer
advanceShallow, getMaxScore, getWeight
Methods inherited from class org.apache.lucene.search.Scorable
setMinCompetitiveScore, smoothingScore
-
Field Details
-
needsScores
private final boolean needsScores -
subScorers
-
approximation
-
blockMaxApprox
-
twoPhase
-
-
Constructor Details
-
DisjunctionScorer
protected DisjunctionScorer(Weight weight, List<Scorer> subScorers, ScoreMode scoreMode) throws IOException - Throws:
IOException
-
-
Method Details
-
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.
-
twoPhaseIterator
Description copied from class:Scorer
Optional method: Return aTwoPhaseIterator
view of thisScorer
. A return value ofnull
indicates that two-phase iteration is not supported.Note that the returned
TwoPhaseIterator
'sapproximation
must advance synchronously with theScorer.iterator()
: advancing the approximation must advance the iterator and vice-versa.Implementing this method is typically useful on
Scorer
s that have a high per-document overhead in order to confirm matches.The default implementation returns
null
.- Overrides:
twoPhaseIterator
in classScorer
-
docID
public final int docID()Description copied from class:Scorable
Returns the doc ID that is currently being scored. -
getBlockMaxApprox
BlockMaxDISI getBlockMaxApprox() -
getSubMatches
- Throws:
IOException
-
score
Description copied from class:Scorable
Returns the score of the current document matching the query.- Specified by:
score
in classScorable
- Throws:
IOException
-
score
Compute the score for the given linked list of scorers.- Throws:
IOException
-
getChildren
Description copied from class:Scorable
Returns child sub-scorers positioned on the current document- Overrides:
getChildren
in classScorable
- Throws:
IOException
-