fail on malformed sort

This commit is contained in:
Shay Banon 2013-03-30 13:58:39 +01:00
parent 6a1cb8f61b
commit 72c76c2799
1 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,8 @@ public class SortParseElement implements SearchParseElement {
addCompoundSortField(parser, context, sortFields);
} else if (token == XContentParser.Token.VALUE_STRING) {
addSortField(context, sortFields, parser.text(), false, false, null, null, null, null);
} else {
throw new ElasticSearchIllegalArgumentException("malformed sort format, within the sort array, an object, or an actual string are allowed");
}
}
} else if (token == XContentParser.Token.VALUE_STRING) {