public abstract class ScoringRewrite<B> extends TermCollectingRewrite<B>
Modifier and Type | Class and Description |
---|---|
(package private) class |
ScoringRewrite.ParallelArraysTermCollector |
(package private) static class |
ScoringRewrite.TermFreqBoostByteStart
Special implementation of BytesStartArray that keeps parallel arrays for boost and docFreq
|
TermCollectingRewrite.TermCollector
Modifier and Type | Field and Description |
---|---|
static MultiTermQuery.RewriteMethod |
CONSTANT_SCORE_BOOLEAN_REWRITE
Like
SCORING_BOOLEAN_REWRITE except
scores are not computed. |
static ScoringRewrite<BooleanQuery.Builder> |
SCORING_BOOLEAN_REWRITE
A rewrite method that first translates each term into
BooleanClause.Occur.SHOULD clause in a
BooleanQuery, and keeps the scores as computed by the
query. |
Constructor and Description |
---|
ScoringRewrite() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkMaxClauseCount(int count)
This method is called after every new term to check if the number of max clauses
(e.g.
|
Query |
rewrite(IndexReader reader,
MultiTermQuery query) |
addClause, addClause, build, collectTerms, getTopLevelBuilder
getTermsEnum
public static final ScoringRewrite<BooleanQuery.Builder> SCORING_BOOLEAN_REWRITE
BooleanClause.Occur.SHOULD
clause in a
BooleanQuery, and keeps the scores as computed by the
query. Note that typically such scores are
meaningless to the user, and require non-trivial CPU
to compute, so it's almost always better to use MultiTermQuery.CONSTANT_SCORE_REWRITE
instead.
NOTE: This rewrite method will hit BooleanQuery.TooManyClauses
if the number of terms
exceeds BooleanQuery.getMaxClauseCount()
.
public static final MultiTermQuery.RewriteMethod CONSTANT_SCORE_BOOLEAN_REWRITE
SCORING_BOOLEAN_REWRITE
except
scores are not computed. Instead, each matching
document receives a constant score equal to the
query's boost.
NOTE: This rewrite method will hit BooleanQuery.TooManyClauses
if the number of terms
exceeds BooleanQuery.getMaxClauseCount()
.
protected abstract void checkMaxClauseCount(int count) throws java.io.IOException
RuntimeException
.java.io.IOException
public final Query rewrite(IndexReader reader, MultiTermQuery query) throws java.io.IOException
rewrite
in class MultiTermQuery.RewriteMethod
java.io.IOException