Fix an incorrect reference to 'zero_terms_docs' in match_phrase queries.

This commit is contained in:
Julie Tibshirani 2018-04-19 13:24:14 -07:00
parent 48461ac143
commit 113d1d3eab
1 changed files with 4 additions and 4 deletions

View File

@ -227,14 +227,14 @@ public class MatchPhraseQueryBuilder extends AbstractQueryBuilder<MatchPhraseQue
} else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { } else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
queryName = parser.text(); queryName = parser.text();
} else if (ZERO_TERMS_QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { } else if (ZERO_TERMS_QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
String zeroTermsDocs = parser.text(); String zeroTermsValue = parser.text();
if ("none".equalsIgnoreCase(zeroTermsDocs)) { if ("none".equalsIgnoreCase(zeroTermsValue)) {
zeroTermsQuery = ZeroTermsQuery.NONE; zeroTermsQuery = ZeroTermsQuery.NONE;
} else if ("all".equalsIgnoreCase(zeroTermsDocs)) { } else if ("all".equalsIgnoreCase(zeroTermsValue)) {
zeroTermsQuery = ZeroTermsQuery.ALL; zeroTermsQuery = ZeroTermsQuery.ALL;
} else { } else {
throw new ParsingException(parser.getTokenLocation(), throw new ParsingException(parser.getTokenLocation(),
"Unsupported zero_terms_docs value [" + zeroTermsDocs + "]"); "Unsupported zero_terms_query value [" + zeroTermsValue + "]");
} }
} else { } else {
throw new ParsingException(parser.getTokenLocation(), throw new ParsingException(parser.getTokenLocation(),