better failure when failing to find mapping for the key field in data histogram
This commit is contained in:
parent
55d112b043
commit
f74fa7511b
|
@ -153,6 +153,9 @@ public class DateHistogramFacetProcessor extends AbstractComponent implements Fa
|
|||
}
|
||||
|
||||
FieldMapper mapper = context.mapperService().smartNameFieldMapper(keyField);
|
||||
if (mapper == null) {
|
||||
throw new FacetPhaseExecutionException(facetName, "(key) field [" + keyField + "] not found");
|
||||
}
|
||||
if (mapper.fieldDataType() != FieldDataType.DefaultTypes.LONG) {
|
||||
throw new FacetPhaseExecutionException(facetName, "(key) field [" + keyField + "] is not of type date");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue