|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.MultiTermQuery.RewriteMethod org.apache.lucene.search.TopTermsRewrite<BooleanQuery> org.apache.lucene.search.MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite
public static final class MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite
A rewrite method that first translates each term into
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.
MultiTermQuery.setRewriteMethod(org.apache.lucene.search.MultiTermQuery.RewriteMethod)
,
Serialized FormNested Class Summary | |
---|---|
protected static interface |
TermCollectingRewrite.TermCollector
|
Constructor Summary | |
---|---|
MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(int size)
Create a TopTermsBoostOnlyBooleanQueryRewrite for at most size terms. |
Method Summary | |
---|---|
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)
|
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. |
Methods inherited from class org.apache.lucene.search.TopTermsRewrite |
---|
equals, getSize, hashCode, rewrite |
Methods inherited from class org.apache.lucene.search.MultiTermQuery.RewriteMethod |
---|
getTermsEnum |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiTermQuery.TopTermsBoostOnlyBooleanQueryRewrite(int size)
size
terms.
NOTE: if BooleanQuery.getMaxClauseCount()
is smaller than
size
, then it will be used instead.
Method Detail |
---|
protected int getMaxSize()
TopTermsRewrite
getMaxSize
in class TopTermsRewrite<BooleanQuery>
protected BooleanQuery getTopLevelQuery()
protected void addClause(BooleanQuery topLevel, Term term, float boost)
protected final void collectTerms(IndexReader reader, MultiTermQuery query, TermCollectingRewrite.TermCollector collector) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |