Serializable
public static final class MultiTermQuery.TopTermsScoringBooleanQueryRewrite extends TopTermsRewrite<BooleanQuery>
BooleanClause.Occur.SHOULD
clause in a BooleanQuery, and keeps the
scores as computed by the query.
This rewrite method only uses the top scoring terms so it will not overflow
the boolean max clause count. It is the default rewrite method for
FuzzyQuery
.
Constructor | Description |
---|---|
TopTermsScoringBooleanQueryRewrite(int size) |
Create a TopTermsScoringBooleanQueryRewrite for
at most
size terms. |
Modifier and Type | Method | 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,
org.apache.lucene.search.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.
|
getTermsEnum
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
equals, getSize, hashCode, rewrite
public TopTermsScoringBooleanQueryRewrite(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, float boost)
protected final void collectTerms(IndexReader reader, MultiTermQuery query, org.apache.lucene.search.TermCollectingRewrite.TermCollector collector) throws IOException
IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.