From 33608c333f19c0db9f91bc299ea3fc2a8c2738f9 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 15 Mar 2013 08:42:19 +0100 Subject: [PATCH] Add `sort_oder` and `sortOrder` as valid field names for defining the sort order in a Sort object. Closes #2767 --- .../java/org/elasticsearch/search/sort/SortParseElement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/search/sort/SortParseElement.java b/src/main/java/org/elasticsearch/search/sort/SortParseElement.java index dd9b7df06a9..bd2ac107239 100644 --- a/src/main/java/org/elasticsearch/search/sort/SortParseElement.java +++ b/src/main/java/org/elasticsearch/search/sort/SortParseElement.java @@ -136,7 +136,7 @@ public class SortParseElement implements SearchParseElement { } else if (token.isValue()) { if ("reverse".equals(innerJsonName)) { reverse = parser.booleanValue(); - } else if ("order".equals(innerJsonName)) { + } else if ("order".equals(innerJsonName) || "sort_order".equals(innerJsonName) || "sortOrder".equals(innerJsonName)) { if ("asc".equals(parser.text())) { reverse = SCORE_FIELD_NAME.equals(fieldName); } else if ("desc".equals(parser.text())) {