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 behindMultiTermQuery.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
Fields Modifier and Type Field Description private static int
POSTINGS_PRE_PROCESS_THRESHOLD
-
Fields 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 Constructor Description MultiTermQueryConstantScoreBlendedWrapper(Q query)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Weight
createWeight(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 Detail
-
POSTINGS_PRE_PROCESS_THRESHOLD
private static final int POSTINGS_PRE_PROCESS_THRESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiTermQueryConstantScoreBlendedWrapper
MultiTermQueryConstantScoreBlendedWrapper(Q query)
-
-
Method Detail
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws java.io.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:
java.io.IOException
-
wrapWithDummyScorer
private static Scorer wrapWithDummyScorer(Weight weight, DocIdSetIterator disi)
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.
-
-