Package org.apache.lucene.search
Class Boolean2ScorerSupplier
- java.lang.Object
-
- org.apache.lucene.search.ScorerSupplier
-
- org.apache.lucene.search.Boolean2ScorerSupplier
-
final class Boolean2ScorerSupplier extends ScorerSupplier
-
-
Field Summary
Fields Modifier and Type Field Description private longcostprivate intminShouldMatchprivate ScoreModescoreModeprivate java.util.Map<BooleanClause.Occur,java.util.Collection<ScorerSupplier>>subsprivate Weightweight
-
Constructor Summary
Constructors Constructor Description Boolean2ScorerSupplier(Weight weight, java.util.Map<BooleanClause.Occur,java.util.Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private longcomputeCost()longcost()Get an estimate of theScorerthat would be returned byScorerSupplier.get(long).private Scorerexcl(Scorer main, java.util.Collection<ScorerSupplier> prohibited, long leadCost)Scorerget(long leadCost)Get theScorer.private ScorergetInternal(long leadCost)private Scoreropt(java.util.Collection<ScorerSupplier> optional, int minShouldMatch, ScoreMode scoreMode, long leadCost)private Scorerreq(java.util.Collection<ScorerSupplier> requiredNoScoring, java.util.Collection<ScorerSupplier> requiredScoring, long leadCost)Create a new scorer for the given required clauses.
-
-
-
Field Detail
-
weight
private final Weight weight
-
subs
private final java.util.Map<BooleanClause.Occur,java.util.Collection<ScorerSupplier>> subs
-
scoreMode
private final ScoreMode scoreMode
-
minShouldMatch
private final int minShouldMatch
-
cost
private long cost
-
-
Constructor Detail
-
Boolean2ScorerSupplier
Boolean2ScorerSupplier(Weight weight, java.util.Map<BooleanClause.Occur,java.util.Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch)
-
-
Method Detail
-
computeCost
private long computeCost()
-
cost
public long cost()
Description copied from class:ScorerSupplierGet an estimate of theScorerthat would be returned byScorerSupplier.get(long). This may be a costly operation, so it should only be called if necessary.- Specified by:
costin classScorerSupplier- See Also:
DocIdSetIterator.cost()
-
get
public Scorer get(long leadCost) throws java.io.IOException
Description copied from class:ScorerSupplierGet theScorer. This may not returnnulland must be called at most once.- Specified by:
getin classScorerSupplier- Parameters:
leadCost- Cost of the scorer that will be used in order to lead iteration. This can be interpreted as an upper bound of the number of times thatDocIdSetIterator.nextDoc(),DocIdSetIterator.advance(int)andTwoPhaseIterator.matches()will be called. Under doubt, passLong.MAX_VALUE, which will produce aScorerthat has good iteration capabilities.- Throws:
java.io.IOException
-
getInternal
private Scorer getInternal(long leadCost) throws java.io.IOException
- Throws:
java.io.IOException
-
req
private Scorer req(java.util.Collection<ScorerSupplier> requiredNoScoring, java.util.Collection<ScorerSupplier> requiredScoring, long leadCost) throws java.io.IOException
Create a new scorer for the given required clauses. Note thatrequiredScoringis a subset ofrequiredcontaining required clauses that should participate in scoring.- Throws:
java.io.IOException
-
excl
private Scorer excl(Scorer main, java.util.Collection<ScorerSupplier> prohibited, long leadCost) throws java.io.IOException
- Throws:
java.io.IOException
-
opt
private Scorer opt(java.util.Collection<ScorerSupplier> optional, int minShouldMatch, ScoreMode scoreMode, long leadCost) throws java.io.IOException
- Throws:
java.io.IOException
-
-