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.
  • 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 class Query
      scoreMode - How the produced scorers will be consumed.
      boost - The boost that is propagated by the parent queries.
      Throws:
      IOException
    • wrapWithDummyScorer

      private static Scorer wrapWithDummyScorer(Weight weight, DocIdSetIterator disi)
      Wraps a DISI with a "dummy" scorer so we can easily use DisiWrapper and DisjunctionDISIApproximation as-is. This is really just a convenient vehicle to get the DISI into the priority queue used by DisjunctionDISIApproximation. The Scorer ultimately provided by the weight provides a constant boost and reflects the actual score mode.