better failure message for sorting when mapping is not found

This commit is contained in:
Shay Banon 2011-10-18 05:54:40 +02:00
parent b113eb18fe
commit 4ffbdbeaea
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ public class SortParseElement implements SearchParseElement {
} else {
FieldMapper fieldMapper = context.smartNameFieldMapper(fieldName);
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));
}