public abstract class TopTermsRewrite<Q extends Query> extends MultiTermQuery.RewriteMethod
Constructor and Description |
---|
TopTermsRewrite(int size)
Create a TopTermsBooleanQueryRewrite for
at most
size terms. |
Modifier and Type | Method and Description |
---|---|
protected void |
addClause(Q topLevel,
Term term,
int docCount,
float boost)
Add a MultiTermQuery term to the top-level query
|
protected abstract void |
addClause(Q topLevel,
Term term,
int docCount,
float boost,
TermContext states) |
boolean |
equals(Object obj) |
protected abstract int |
getMaxSize()
return the maximum size of the priority queue (for boolean rewrites this is BooleanQuery#getMaxClauseCount).
|
int |
getSize()
return the maximum priority queue size
|
protected abstract Q |
getTopLevelQuery()
Return a suitable top-level Query for holding all expanded terms.
|
int |
hashCode() |
Q |
rewrite(IndexReader reader,
MultiTermQuery query) |
getTermsEnum
public TopTermsRewrite(int size)
size
terms.
NOTE: if BooleanQuery.getMaxClauseCount()
is smaller than
size
, then it will be used instead.
public int getSize()
protected abstract int getMaxSize()
public final Q rewrite(IndexReader reader, MultiTermQuery query) throws IOException
rewrite
in class MultiTermQuery.RewriteMethod
IOException
protected abstract Q getTopLevelQuery() throws IOException
IOException
protected final void addClause(Q topLevel, Term term, int docCount, float boost) throws IOException
IOException
protected abstract void addClause(Q topLevel, Term term, int docCount, float boost, TermContext states) throws IOException
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.