mlt_field doesn't support boost, closes #1773.
This commit is contained in:
parent
e7a892f6f0
commit
d9963926dc
|
@ -81,6 +81,8 @@ public class MoreLikeThisQuery extends Query {
|
|||
BooleanClause[] clauses = bq.getClauses();
|
||||
|
||||
bq.setMinimumNumberShouldMatch((int) (clauses.length * percentTermsToMatch));
|
||||
|
||||
bq.setBoost(getBoost());
|
||||
return bq;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ public class MoreLikeThisFieldQueryParser implements QueryParser {
|
|||
mltQuery.setPercentTermsToMatch(parser.floatValue());
|
||||
} else if ("analyzer".equals(currentFieldName)) {
|
||||
analyzer = parseContext.analysisService().analyzer(parser.text());
|
||||
} else if ("boost".equals(currentFieldName)) {
|
||||
mltQuery.setBoost(parser.floatValue());
|
||||
} else {
|
||||
throw new QueryParsingException(parseContext.index(), "[mlt_field] query does not support [" + currentFieldName + "]");
|
||||
}
|
||||
|
|
|
@ -83,6 +83,8 @@ public class MoreLikeThisQueryParser implements QueryParser {
|
|||
mltQuery.setPercentTermsToMatch(parser.floatValue());
|
||||
} else if ("analyzer".equals(currentFieldName)) {
|
||||
analyzer = parseContext.analysisService().analyzer(parser.text());
|
||||
} else if ("boost".equals(currentFieldName)) {
|
||||
mltQuery.setBoost(parser.floatValue());
|
||||
} else {
|
||||
throw new QueryParsingException(parseContext.index(), "[mlt] query does not support [" + currentFieldName + "]");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue