An abstract {@link Query} that matches documents
containing a subset of terms provided by a {@link
FilteredTermEnum} enumeration.
This query cannot be used directly; you must subclass
it and define {@link #getEnum} to provide a {@link
FilteredTermEnum} that iterates through the terms to be
matched.
NOTE: if {@link #setRewriteMethod} is either
{@link #CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE} or {@link
#SCORING_BOOLEAN_QUERY_REWRITE}, you may encounter a
{@link BooleanQuery.TooManyClauses} exception during
searching, which happens when the number of terms to be
searched exceeds {@link
BooleanQuery#GetMaxClauseCount()}. Setting {@link
#setRewriteMethod} to {@link #CONSTANT_SCORE_FILTER_REWRITE}
prevents this.
The recommended rewrite method is {@link
#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}: it doesn't spend CPU
computing unhelpful scores, and it tries to pick the most
performant rewrite method given the query.
Note that {@link QueryParser} produces
MultiTermQueries using {@link
#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} by default.
The MultiTermQuery..::..ConstantScoreAutoRewrite type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MultiTermQuery..::..ConstantScoreAutoRewrite | Initializes a new instance of the MultiTermQuery..::..ConstantScoreAutoRewrite class |
Methods
Name | Description | |
---|---|---|
Equals | (Overrides Object..::..Equals(Object).) | |
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetDocCountPercent | ||
GetHashCode | (Overrides Object..::..GetHashCode()()()().) | |
GetTermCountCutoff | ||
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Rewrite | (Overrides MultiTermQuery..::..RewriteMethod..::..Rewrite(IndexReader, MultiTermQuery).) | |
SetDocCountPercent | If the number of documents to be visited in the
postings exceeds this specified percentage of the
maxDoc() for the index, then {@link
#CONSTANT_SCORE_FILTER_REWRITE} is used.
| |
SetTermCountCutoff | If the number of terms in this query is equal to or
larger than this setting then {@link
#CONSTANT_SCORE_FILTER_REWRITE} is used.
| |
ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
DEFAULT_DOC_COUNT_PERCENT | ||
DEFAULT_TERM_COUNT_CUTOFF |