Fix incorrect references to 'zero_terms_docs' in query parsing error messages. (#29599)
This commit is contained in:
parent
4f282e9e32
commit
00d88a5d3e
|
@ -507,14 +507,14 @@ public class MatchQueryBuilder extends AbstractQueryBuilder<MatchQueryBuilder> {
|
|||
} else if (CUTOFF_FREQUENCY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
cutOffFrequency = parser.floatValue();
|
||||
} else if (ZERO_TERMS_QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
String zeroTermsDocs = parser.text();
|
||||
if ("none".equalsIgnoreCase(zeroTermsDocs)) {
|
||||
String zeroTermsValue = parser.text();
|
||||
if ("none".equalsIgnoreCase(zeroTermsValue)) {
|
||||
zeroTermsQuery = MatchQuery.ZeroTermsQuery.NONE;
|
||||
} else if ("all".equalsIgnoreCase(zeroTermsDocs)) {
|
||||
} else if ("all".equalsIgnoreCase(zeroTermsValue)) {
|
||||
zeroTermsQuery = MatchQuery.ZeroTermsQuery.ALL;
|
||||
} else {
|
||||
throw new ParsingException(parser.getTokenLocation(),
|
||||
"Unsupported zero_terms_docs value [" + zeroTermsDocs + "]");
|
||||
"Unsupported zero_terms_query value [" + zeroTermsValue + "]");
|
||||
}
|
||||
} else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
queryName = parser.text();
|
||||
|
|
|
@ -684,13 +684,14 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
|
|||
} else if (LENIENT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
lenient = parser.booleanValue();
|
||||
} else if (ZERO_TERMS_QUERY_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
String zeroTermsDocs = parser.text();
|
||||
if ("none".equalsIgnoreCase(zeroTermsDocs)) {
|
||||
String zeroTermsValue = parser.text();
|
||||
if ("none".equalsIgnoreCase(zeroTermsValue)) {
|
||||
zeroTermsQuery = MatchQuery.ZeroTermsQuery.NONE;
|
||||
} else if ("all".equalsIgnoreCase(zeroTermsDocs)) {
|
||||
} else if ("all".equalsIgnoreCase(zeroTermsValue)) {
|
||||
zeroTermsQuery = MatchQuery.ZeroTermsQuery.ALL;
|
||||
} else {
|
||||
throw new ParsingException(parser.getTokenLocation(), "Unsupported zero_terms_docs value [" + zeroTermsDocs + "]");
|
||||
throw new ParsingException(parser.getTokenLocation(),
|
||||
"Unsupported zero_terms_query value [" + zeroTermsValue + "]");
|
||||
}
|
||||
} else if (AbstractQueryBuilder.NAME_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
queryName = parser.text();
|
||||
|
|
Loading…
Reference in New Issue