better failure message for sorting when mapping is not found
This commit is contained in:
parent
b113eb18fe
commit
4ffbdbeaea
|
@ -140,7 +140,7 @@ public class SortParseElement implements SearchParseElement {
|
||||||
} else {
|
} else {
|
||||||
FieldMapper fieldMapper = context.smartNameFieldMapper(fieldName);
|
FieldMapper fieldMapper = context.smartNameFieldMapper(fieldName);
|
||||||
if (fieldMapper == null) {
|
if (fieldMapper == null) {
|
||||||
throw new SearchParseException(context, "No mapping found for [" + fieldName + "]");
|
throw new SearchParseException(context, "No mapping found for [" + fieldName + "] in order to sort on");
|
||||||
}
|
}
|
||||||
sortFields.add(new SortField(fieldMapper.names().indexName(), fieldMapper.fieldDataType().newFieldComparatorSource(context.fieldDataCache(), missing), reverse));
|
sortFields.add(new SortField(fieldMapper.names().indexName(), fieldMapper.fieldDataType().newFieldComparatorSource(context.fieldDataCache(), missing), reverse));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue