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, query
Fields 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 Scorer
wrapWithDummyScorer
(Weight weight, DocIdSetIterator disi) Wraps a DISI with a "dummy" scorer so we can easily useDisiWrapper
andDisjunctionDISIApproximation
as-is.Methods inherited from class org.apache.lucene.search.AbstractMultiTermQueryConstantScoreWrapper
equals, getField, getQuery, hashCode, ramBytesUsed, toString, visit
Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, rewrite, sameClassAs, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:Query
Expert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeight
in classQuery
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 useDisiWrapper
andDisjunctionDISIApproximation
as-is. This is really just a convenient vehicle to get the DISI into the priority queue used byDisjunctionDISIApproximation
. TheScorer
ultimately provided by the weight provides a constant boost and reflects the actual score mode.
-