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 classDisjunctionScorer.TwoPhase-
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
-
Field Summary
Fields Modifier and Type Field Description private DocIdSetIteratorapproximationprivate BlockMaxDISIblockMaxApproxprivate booleanneedsScoresprivate DisiPriorityQueuesubScorersprivate DisjunctionScorer.TwoPhasetwoPhase
-
Constructor Summary
Constructors Modifier Constructor Description protectedDisjunctionScorer(Weight weight, java.util.List<Scorer> subScorers, ScoreMode scoreMode)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intdocID()Returns the doc ID that is currently being scored.(package private) BlockMaxDISIgetBlockMaxApprox()java.util.Collection<Scorable.ChildScorable>getChildren()Returns child sub-scorers positioned on the current document(package private) DisiWrappergetSubMatches()DocIdSetIteratoriterator()Return aDocIdSetIteratorover matching documents.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.TwoPhaseIteratortwoPhaseIterator()Optional method: Return aTwoPhaseIteratorview 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: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
public TwoPhaseIterator 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 returnedTwoPhaseIterator'sapproximationmust advance synchronously with theScorer.iterator(): advancing the approximation must advance the iterator and vice-versa. Implementing this method is typically useful onScorers that have a high per-document overhead in order to confirm matches. The default implementation returnsnull.- Overrides:
twoPhaseIteratorin classScorer
-
docID
public final int docID()
Description copied from class:ScorableReturns 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.IOExceptionDescription copied from class:ScorableReturns 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:ScorableReturns child sub-scorers positioned on the current document- Overrides:
getChildrenin classScorable- Throws:
java.io.IOException
-
-