The MultiTermQuery type exposes the following members.

Fields

  NameDescription
Public fieldStatic memberCONSTANT_SCORE_AUTO_REWRITE_DEFAULT
Read-only default instance of {@link ConstantScoreAutoRewrite}, with {@link ConstantScoreAutoRewrite#setTermCountCutoff} set to {@link ConstantScoreAutoRewrite#DEFAULT_TERM_COUNT_CUTOFF} and {@link ConstantScoreAutoRewrite#setDocCountPercent} set to {@link ConstantScoreAutoRewrite#DEFAULT_DOC_COUNT_PERCENT}. Note that you cannot alter the configuration of this instance; you'll need to create a private instance instead.
Public fieldStatic memberCONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
Like {@link #SCORING_BOOLEAN_QUERY_REWRITE} except scores are not computed. Instead, each matching document receives a constant score equal to the query's boost.

NOTE: This rewrite method will hit {@link BooleanQuery.TooManyClauses} if the number of terms exceeds {@link BooleanQuery#getMaxClauseCount}.

Public fieldStatic memberCONSTANT_SCORE_FILTER_REWRITE
A rewrite method that first creates a private Filter, by visiting each term in sequence and marking all docs for that term. Matching documents are assigned a constant score equal to the query's boost.

This method is faster than the BooleanQuery rewrite methods when the number of matched terms or matched documents is non-trivial. Also, it will never hit an errant {@link BooleanQuery.TooManyClauses} exception.

Protected fieldrewriteMethod
Public fieldStatic memberSCORING_BOOLEAN_QUERY_REWRITE
A rewrite method that first translates each term into {@link BooleanClause.Occur#SHOULD} clause in a BooleanQuery, and keeps the scores as computed by the query. Note that typically such scores are meaningless to the user, and require non-trivial CPU to compute, so it's almost always better to use {@link #CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} instead.

NOTE: This rewrite method will hit {@link BooleanQuery.TooManyClauses} if the number of terms exceeds {@link BooleanQuery#getMaxClauseCount}.

Protected fieldterm

See Also