Package org.apache.lucene.search
Class MultiTermQuery.ConstantScoreAutoRewrite
java.lang.Object
org.apache.lucene.search.MultiTermQuery.RewriteMethod
org.apache.lucene.search.MultiTermQuery.ConstantScoreAutoRewrite
- Enclosing class:
MultiTermQuery
A rewrite method that tries to pick the best
constant-score rewrite method based on term and
document counts from the query. If both the number of
terms and documents is small enough, then
MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
is used.
Otherwise, MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is
used.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic double
static int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
double
int
int
hashCode()
rewrite
(IndexReader reader, MultiTermQuery query) void
setDocCountPercent
(double percent) If the number of documents to be visited in the postings exceeds this specified percentage of the maxDoc() for the index, thenMultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used.void
setTermCountCutoff
(int count) If the number of terms in this query is equal to or larger than this setting thenMultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used.
-
Field Details
-
DEFAULT_TERM_COUNT_CUTOFF
public static int DEFAULT_TERM_COUNT_CUTOFF -
DEFAULT_DOC_COUNT_PERCENT
public static double DEFAULT_DOC_COUNT_PERCENT
-
-
Constructor Details
-
ConstantScoreAutoRewrite
public ConstantScoreAutoRewrite()
-
-
Method Details
-
setTermCountCutoff
public void setTermCountCutoff(int count) If the number of terms in this query is equal to or larger than this setting thenMultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used. -
getTermCountCutoff
public int getTermCountCutoff()- See Also:
-
setDocCountPercent
public void setDocCountPercent(double percent) If the number of documents to be visited in the postings exceeds this specified percentage of the maxDoc() for the index, thenMultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used.- Parameters:
percent
- 0.0 to 100.0
-
getDocCountPercent
public double getDocCountPercent()- See Also:
-
rewrite
- Specified by:
rewrite
in classMultiTermQuery.RewriteMethod
- Throws:
IOException
-
hashCode
public int hashCode() -
equals
-