public abstract class TopTermsRewrite<B> extends TermCollectingRewrite<B>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TopTermsRewrite.ScoreTerm |
TermCollectingRewrite.TermCollector
Modifier and Type | Field and Description |
---|---|
private static java.util.Comparator<TopTermsRewrite.ScoreTerm> |
scoreTermSortByTermComp |
private int |
size |
Constructor and Description |
---|
TopTermsRewrite(int size)
Create a TopTermsBooleanQueryRewrite for
at most
size terms. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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
|
int |
hashCode() |
Query |
rewrite(IndexReader reader,
MultiTermQuery query) |
addClause, addClause, build, collectTerms, getTopLevelBuilder
getTermsEnum
private final int size
private static final java.util.Comparator<TopTermsRewrite.ScoreTerm> scoreTermSortByTermComp
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 Query rewrite(IndexReader reader, MultiTermQuery query) throws java.io.IOException
rewrite
in class MultiTermQuery.RewriteMethod
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object