Package org.apache.lucene.search
Class ScoringRewrite<Q extends Query>
java.lang.Object
org.apache.lucene.search.MultiTermQuery.RewriteMethod
org.apache.lucene.search.ScoringRewrite<Q>
Base rewrite method that translates each term into a query, and keeps
the scores as computed by the query.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MultiTermQuery.RewriteMethodLikeSCORING_BOOLEAN_QUERY_REWRITEexcept scores are not computed.static final ScoringRewrite<BooleanQuery> A rewrite method that first translates each term intoBooleanClause.Occur.SHOULDclause in a BooleanQuery, and keeps the scores as computed by the query. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SCORING_BOOLEAN_QUERY_REWRITE
A rewrite method that first translates each term intoBooleanClause.Occur.SHOULDclause 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 useMultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULTinstead.NOTE: This rewrite method will hit
BooleanQuery.TooManyClausesif the number of terms exceedsBooleanQuery.getMaxClauseCount().- See Also:
-
CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
LikeSCORING_BOOLEAN_QUERY_REWRITEexcept 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.TooManyClausesif the number of terms exceedsBooleanQuery.getMaxClauseCount().- See Also:
-
-
Constructor Details
-
ScoringRewrite
public ScoringRewrite()
-
-
Method Details
-
rewrite
- Specified by:
rewritein classMultiTermQuery.RewriteMethod- Throws:
IOException
-