Module org.apache.lucene.core
Package org.apache.lucene.search
Class MultiTermQueryConstantScoreBlendedWrapper<Q extends MultiTermQuery>
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.AbstractMultiTermQueryConstantScoreWrapper<Q>
org.apache.lucene.search.MultiTermQueryConstantScoreBlendedWrapper<Q>
- All Implemented Interfaces:
Accountable
final class MultiTermQueryConstantScoreBlendedWrapper<Q extends MultiTermQuery>
extends AbstractMultiTermQueryConstantScoreWrapper<Q>
This class provides the functionality behind
MultiTermQuery.CONSTANT_SCORE_BLENDED_REWRITE. It maintains a boolean query-like approach over a
limited number of the most costly terms while rewriting the remaining terms into a filter bitset.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.AbstractMultiTermQueryConstantScoreWrapper
AbstractMultiTermQueryConstantScoreWrapper.RewritingWeight, AbstractMultiTermQueryConstantScoreWrapper.TermAndState, AbstractMultiTermQueryConstantScoreWrapper.WeightOrDocIdSetIterator -
Field Summary
FieldsFields inherited from class org.apache.lucene.search.AbstractMultiTermQueryConstantScoreWrapper
BOOLEAN_REWRITE_TERM_COUNT_THRESHOLD, queryFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) Expert: Constructs an appropriate Weight implementation for this query.private static ScorerwrapWithDummyScorer(Weight weight, DocIdSetIterator disi) Wraps a DISI with a "dummy" scorer so we can easily useDisiWrapperandDisjunctionDISIApproximationas-is.Methods inherited from class org.apache.lucene.search.AbstractMultiTermQueryConstantScoreWrapper
equals, getField, getQuery, hashCode, ramBytesUsed, toString, visitMethods inherited from class org.apache.lucene.search.Query
classHash, rewrite, rewrite, sameClassAs, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
POSTINGS_PRE_PROCESS_THRESHOLD
private static final int POSTINGS_PRE_PROCESS_THRESHOLD- See Also:
-
-
Constructor Details
-
MultiTermQueryConstantScoreBlendedWrapper
MultiTermQueryConstantScoreBlendedWrapper(Q query)
-
-
Method Details
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classQuery- Parameters:
scoreMode- How the produced scorers will be consumed.boost- The boost that is propagated by the parent queries.- Throws:
IOException
-
wrapWithDummyScorer
Wraps a DISI with a "dummy" scorer so we can easily useDisiWrapperandDisjunctionDISIApproximationas-is. This is really just a convenient vehicle to get the DISI into the priority queue used byDisjunctionDISIApproximation. TheScorerultimately provided by the weight provides a constant boost and reflects the actual score mode.
-