java.lang.Object
org.apache.lucene.search.ScorerSupplier
org.apache.lucene.search.Boolean2ScorerSupplier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final intprivate final ScoreModeprivate final Map<BooleanClause.Occur,Collection<ScorerSupplier>> private final Weight -
Constructor Summary
ConstructorsConstructorDescriptionBoolean2ScorerSupplier(Weight weight, Map<BooleanClause.Occur, Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch) -
Method Summary
Modifier and TypeMethodDescriptionprivate longlongcost()Get an estimate of theScorerthat would be returned byScorerSupplier.get(long).private Scorerexcl(Scorer main, Collection<ScorerSupplier> prohibited, long leadCost) get(long leadCost) Get theScorer.private ScorergetInternal(long leadCost) private Scoreropt(Collection<ScorerSupplier> optional, int minShouldMatch, ScoreMode scoreMode, long leadCost) private Scorerreq(Collection<ScorerSupplier> requiredNoScoring, Collection<ScorerSupplier> requiredScoring, long leadCost) Create a new scorer for the given required clauses.
-
Field Details
-
weight
-
subs
-
scoreMode
-
minShouldMatch
private final int minShouldMatch -
cost
private long cost
-
-
Constructor Details
-
Boolean2ScorerSupplier
Boolean2ScorerSupplier(Weight weight, Map<BooleanClause.Occur, Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch)
-
-
Method Details
-
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:
-
get
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:
IOException
-
getInternal
- Throws:
IOException
-
req
private Scorer req(Collection<ScorerSupplier> requiredNoScoring, Collection<ScorerSupplier> requiredScoring, long leadCost) throws IOException Create a new scorer for the given required clauses. Note thatrequiredScoringis a subset ofrequiredcontaining required clauses that should participate in scoring.- Throws:
IOException
-
excl
private Scorer excl(Scorer main, Collection<ScorerSupplier> prohibited, long leadCost) throws IOException - Throws:
IOException
-
opt
private Scorer opt(Collection<ScorerSupplier> optional, int minShouldMatch, ScoreMode scoreMode, long leadCost) throws IOException - Throws:
IOException
-