better exception when a field is missing
This commit is contained in:
parent
cccefad091
commit
2c65be2aad
|
@ -103,6 +103,10 @@ public class RangeFilterParser extends AbstractIndexComponent implements XConten
|
|||
}
|
||||
}
|
||||
|
||||
if (fieldName == null) {
|
||||
throw new QueryParsingException(index, "No field specified for range filter");
|
||||
}
|
||||
|
||||
Filter filter = null;
|
||||
MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName);
|
||||
if (smartNameFieldMappers != null) {
|
||||
|
|
|
@ -75,6 +75,10 @@ public class TermFilterParser extends AbstractIndexComponent implements XContent
|
|||
}
|
||||
}
|
||||
|
||||
if (fieldName == null) {
|
||||
throw new QueryParsingException(index, "No field specified for term filter");
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
throw new QueryParsingException(index, "No value specified for term filter");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue