Add additional query validation to the terms query parser

Fixes #2608
This commit is contained in:
Igor Motov 2013-02-01 08:52:20 -05:00
parent ebc0c8cc6d
commit 20ce01bd53

View File

@ -92,12 +92,18 @@ public class TermsQueryParser implements QueryParser {
minimumShouldMatch = parser.textOrNull();
} else if ("boost".equals(currentFieldName)) {
boost = parser.floatValue();
} else {
throw new QueryParsingException(parseContext.index(), "[terms] query does not support [" + currentFieldName + "]");
}
} else {
throw new QueryParsingException(parseContext.index(), "[terms] query does not support [" + currentFieldName + "]");
}
}
if (fieldName == null) {
throw new QueryParsingException(parseContext.index(), "No field specified for terms query");
}
FieldMapper mapper = null;
MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName);
String[] previousTypes = null;