LUCENE-1644: fix highlighter to rewrite MTQ whenever it's not already a SCORING_BOOLEAN_QUERY

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@797728 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-07-25 09:31:17 +00:00
parent 187ac2b4f3
commit 228888a882
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ public class WeightedSpanTermExtractor {
terms.putAll(disjunctTerms);
} else if (query instanceof MultiTermQuery && (highlightCnstScrRngQuery || expandMultiTermQuery)) {
MultiTermQuery mtq = ((MultiTermQuery)query);
if(mtq.getRewriteMethod() == MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE) {
if(mtq.getRewriteMethod() != MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE) {
mtq = copyMultiTermQuery(mtq);
mtq.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
query = mtq;