public static class MultiTermQuery.ConstantScoreAutoRewrite extends MultiTermQuery.RewriteMethod
MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
is used.
Otherwise, MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is
used.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DOC_COUNT_PERCENT |
static int |
DEFAULT_TERM_COUNT_CUTOFF |
Constructor and Description |
---|
MultiTermQuery.ConstantScoreAutoRewrite() |
Modifier and Type | Method and Description |
---|---|
protected void |
addClause(BooleanQuery topLevel,
Term term,
int docFreq,
float boost,
TermContext states) |
protected void |
addClause(Q topLevel,
Term term,
int docCount,
float boost)
Add a MultiTermQuery term to the top-level query
|
boolean |
equals(Object obj) |
double |
getDocCountPercent() |
int |
getTermCountCutoff() |
protected BooleanQuery |
getTopLevelQuery()
Return a suitable top-level Query for holding all expanded terms.
|
int |
hashCode() |
Query |
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, then
MultiTermQuery.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 then
MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE is used. |
getTermsEnum
public static int DEFAULT_TERM_COUNT_CUTOFF
public static double DEFAULT_DOC_COUNT_PERCENT
public MultiTermQuery.ConstantScoreAutoRewrite()
public void setTermCountCutoff(int count)
MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used.public int getTermCountCutoff()
setTermCountCutoff(int)
public void setDocCountPercent(double percent)
MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
is used.percent
- 0.0 to 100.0public double getDocCountPercent()
setDocCountPercent(double)
protected BooleanQuery getTopLevelQuery()
protected void addClause(BooleanQuery topLevel, Term term, int docFreq, float boost, TermContext states)
public Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException
rewrite
in class MultiTermQuery.RewriteMethod
IOException
protected final void addClause(Q topLevel, Term term, int docCount, float boost) throws IOException
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.