public static final class MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite extends TopTermsRewrite<BooleanQuery>
BooleanClause.Occur.SHOULD
clause in a BooleanQuery, but the scores
are only computed as the boost.
This rewrite method only uses the top scoring terms so it will not overflow the boolean max clause count.
Constructor and Description |
---|
MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(int size)
Create a TopTermsBoostOnlyBooleanQueryRewrite for
at most
size terms. |
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
|
protected int |
getMaxSize()
return the maximum size of the priority queue (for boolean rewrites this is BooleanQuery#getMaxClauseCount).
|
protected BooleanQuery |
getTopLevelQuery()
Return a suitable top-level Query for holding all expanded terms.
|
equals, getSize, hashCode, rewrite
getTermsEnum
public MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(int size)
size
terms.
NOTE: if BooleanQuery.getMaxClauseCount()
is smaller than
size
, then it will be used instead.
protected int getMaxSize()
TopTermsRewrite
getMaxSize
in class TopTermsRewrite<BooleanQuery>
protected BooleanQuery getTopLevelQuery()
protected void addClause(BooleanQuery topLevel, Term term, int docFreq, float boost, TermContext states)
protected final void addClause(Q topLevel, Term term, int docCount, float boost) throws IOException
IOException
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.