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 | Class and Description |
---|---|
protected static interface |
TermCollectingRewrite.TermCollector |
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,
float boost)
Add a MultiTermQuery term to the top-level query
|
protected void |
collectTerms(IndexReader reader,
MultiTermQuery query,
TermCollectingRewrite.TermCollector collector) |
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, float boost)
public Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException
rewrite
in class MultiTermQuery.RewriteMethod
IOException
protected final void collectTerms(IndexReader reader, MultiTermQuery query, TermCollectingRewrite.TermCollector collector) throws IOException
IOException