public abstract class ScoringRewrite<Q extends Query> extends MultiTermQuery.RewriteMethod
| Modifier and Type | Field and Description |
|---|---|
static MultiTermQuery.RewriteMethod |
CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
Like
SCORING_BOOLEAN_QUERY_REWRITE except
scores are not computed. |
static ScoringRewrite<BooleanQuery> |
SCORING_BOOLEAN_QUERY_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 |
|---|---|
Q |
rewrite(IndexReader reader,
MultiTermQuery query) |
public static final ScoringRewrite<BooleanQuery> SCORING_BOOLEAN_QUERY_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_AUTO_REWRITE_DEFAULT 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_QUERY_REWRITE
SCORING_BOOLEAN_QUERY_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().
public final Q rewrite(IndexReader reader, MultiTermQuery query) throws IOException
rewrite in class MultiTermQuery.RewriteMethodIOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved