Package org.apache.lucene.search
Class DisjunctionScorer
- java.lang.Object
-
- org.apache.lucene.search.Scorable
-
- org.apache.lucene.search.Scorer
-
- org.apache.lucene.search.DisjunctionScorer
-
- Direct Known Subclasses:
DisjunctionMaxScorer
,DisjunctionSumScorer
abstract class DisjunctionScorer extends Scorer
Base class for Scorers that score disjunctions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DisjunctionScorer.TwoPhase
-
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
-
Field Summary
Fields Modifier and Type Field Description private DocIdSetIterator
approximation
private BlockMaxDISI
blockMaxApprox
private boolean
needsScores
private DisiPriorityQueue
subScorers
private DisjunctionScorer.TwoPhase
twoPhase
-
Constructor Summary
Constructors Modifier Constructor Description protected
DisjunctionScorer(Weight weight, java.util.List<Scorer> subScorers, ScoreMode scoreMode)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
docID()
Returns the doc ID that is currently being scored.(package private) BlockMaxDISI
getBlockMaxApprox()
java.util.Collection<Scorable.ChildScorable>
getChildren()
Returns child sub-scorers positioned on the current document(package private) DisiWrapper
getSubMatches()
DocIdSetIterator
iterator()
Return aDocIdSetIterator
over matching documents.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.TwoPhaseIterator
twoPhaseIterator()
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
-
-
-
-
Field Detail
-
needsScores
private final boolean needsScores
-
subScorers
private final DisiPriorityQueue subScorers
-
approximation
private final DocIdSetIterator approximation
-
blockMaxApprox
private final BlockMaxDISI blockMaxApprox
-
twoPhase
private final DisjunctionScorer.TwoPhase twoPhase
-
-
Method Detail
-
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.
-
twoPhaseIterator
public TwoPhaseIterator 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 returnedTwoPhaseIterator
'sapproximation
must advance synchronously with theScorer.iterator()
: advancing the approximation must advance the iterator and vice-versa. Implementing this method is typically useful onScorer
s that have a high per-document overhead in order to confirm matches. The default implementation returnsnull
.- 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
DisiWrapper getSubMatches() throws java.io.IOException
- Throws:
java.io.IOException
-
score
public final float score() throws java.io.IOException
Description copied from class:Scorable
Returns the score of the current document matching the query.
-
score
protected abstract float score(DisiWrapper topList) throws java.io.IOException
Compute the score for the given linked list of scorers.- Throws:
java.io.IOException
-
getChildren
public final java.util.Collection<Scorable.ChildScorable> getChildren() throws java.io.IOException
Description copied from class:Scorable
Returns child sub-scorers positioned on the current document- Overrides:
getChildren
in classScorable
- Throws:
java.io.IOException
-
-