mirror of https://github.com/apache/lucene.git
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:
parent
187ac2b4f3
commit
228888a882
|
@ -136,7 +136,7 @@ public class WeightedSpanTermExtractor {
|
||||||
terms.putAll(disjunctTerms);
|
terms.putAll(disjunctTerms);
|
||||||
} else if (query instanceof MultiTermQuery && (highlightCnstScrRngQuery || expandMultiTermQuery)) {
|
} else if (query instanceof MultiTermQuery && (highlightCnstScrRngQuery || expandMultiTermQuery)) {
|
||||||
MultiTermQuery mtq = ((MultiTermQuery)query);
|
MultiTermQuery mtq = ((MultiTermQuery)query);
|
||||||
if(mtq.getRewriteMethod() == MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE) {
|
if(mtq.getRewriteMethod() != MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE) {
|
||||||
mtq = copyMultiTermQuery(mtq);
|
mtq = copyMultiTermQuery(mtq);
|
||||||
mtq.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
|
mtq.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
|
||||||
query = mtq;
|
query = mtq;
|
||||||
|
|
Loading…
Reference in New Issue