java.lang.Object
org.apache.lucene.search.ScorerSupplier
org.apache.lucene.search.BooleanScorerSupplier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final intprivate final intprivate final ScoreModeprivate final Map<BooleanClause.Occur, Collection<ScorerSupplier>> private boolean -
Constructor Summary
ConstructorsConstructorDescriptionBooleanScorerSupplier(Weight weight, Map<BooleanClause.Occur, Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch, int maxDoc) -
Method Summary
Modifier and TypeMethodDescription(package private) BulkScorerOptional method: Get a scorer that is optimized for bulk-scoring.private longlongcost()Get an estimate of theScorerthat would be returned byScorerSupplier.get(long).(package private) static BulkScorerdisableScoring(BulkScorer scorer) private Scorerexcl(Scorer main, Collection<ScorerSupplier> prohibited, long leadCost) (package private) BulkScorerget(long leadCost) Get theScorer.private ScorergetInternal(long leadCost) private Scoreropt(Collection<ScorerSupplier> optional, int minShouldMatch, ScoreMode scoreMode, long leadCost, boolean topLevelScoringClause) (package private) BulkScorerprivate Scorerreq(Collection<ScorerSupplier> requiredNoScoring, Collection<ScorerSupplier> requiredScoring, long leadCost, boolean topLevelScoringClause) Create a new scorer for the given required clauses.private BulkScorervoidInform thisScorerSupplierthat its returned scorers produce scores that get passed to the collector, as opposed to partial scores that then need to get combined (e.g.
-
Field Details
-
subs
-
scoreMode
-
minShouldMatch
private final int minShouldMatch -
maxDoc
private final int maxDoc -
cost
private long cost -
topLevelScoringClause
private boolean topLevelScoringClause
-
-
Constructor Details
-
BooleanScorerSupplier
BooleanScorerSupplier(Weight weight, Map<BooleanClause.Occur, Collection<ScorerSupplier>> subs, ScoreMode scoreMode, int minShouldMatch, int maxDoc)
-
-
Method Details
-
computeCost
private long computeCost() -
setTopLevelScoringClause
Description copied from class:ScorerSupplierInform thisScorerSupplierthat its returned scorers produce scores that get passed to the collector, as opposed to partial scores that then need to get combined (e.g. summed up). Note that this method also gets called if scores are not requested, e.g. because the score mode isScoreMode.COMPLETE_NO_SCORES, so implementations should look at both the score mode and this boolean to know whether to prepare for reacting toScorable.setMinCompetitiveScore(float)calls.- Overrides:
setTopLevelScoringClausein classScorerSupplier- Throws:
IOException
-
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
-
bulkScorer
Description copied from class:ScorerSupplierOptional method: Get a scorer that is optimized for bulk-scoring. The default implementation iterates matches from theScorerbut some queries can have more efficient approaches for matching all hits.- Overrides:
bulkScorerin classScorerSupplier- Throws:
IOException
-
booleanScorer
- Throws:
IOException
-
disableScoring
-
optionalBulkScorer
- Throws:
IOException
-
filteredOptionalBulkScorer
- Throws:
IOException
-
requiredBulkScorer
- Throws:
IOException
-
req
private Scorer req(Collection<ScorerSupplier> requiredNoScoring, Collection<ScorerSupplier> requiredScoring, long leadCost, boolean topLevelScoringClause) 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, boolean topLevelScoringClause) throws IOException - Throws:
IOException
-