From e0eff7d9d38531697fdf163bceec69ecdc95bde4 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 15 Mar 2013 13:55:35 +0100 Subject: [PATCH] Remove `sort_order` and `sort_mode` in favor of `order` and `mode` Closes #2781 --- .../java/org/elasticsearch/search/sort/FieldSortBuilder.java | 2 +- .../java/org/elasticsearch/search/sort/SortParseElement.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java b/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java index 2caf44078e9..2b7f2c9f62c 100644 --- a/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java +++ b/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java @@ -127,7 +127,7 @@ public class FieldSortBuilder extends SortBuilder { builder.field("ignore_unmapped", ignoreUnampped); } if (sortMode != null) { - builder.field("sort_mode", sortMode); + builder.field("mode", sortMode); } if (nestedFilter != null) { builder.field("nested_filter", nestedFilter, params); diff --git a/src/main/java/org/elasticsearch/search/sort/SortParseElement.java b/src/main/java/org/elasticsearch/search/sort/SortParseElement.java index bd2ac107239..f3d1eef6542 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) || "sort_order".equals(innerJsonName) || "sortOrder".equals(innerJsonName)) { + } else if ("order".equals(innerJsonName)) { if ("asc".equals(parser.text())) { reverse = SCORE_FIELD_NAME.equals(fieldName); } else if ("desc".equals(parser.text())) { @@ -146,7 +146,7 @@ public class SortParseElement implements SearchParseElement { missing = parser.textOrNull(); } else if ("ignore_unmapped".equals(innerJsonName) || "ignoreUnmapped".equals(innerJsonName)) { ignoreUnmapped = parser.booleanValue(); - } else if ("sort_mode".equals(innerJsonName) || "sortMode".equals(innerJsonName) || "mode".equals(innerJsonName)) { + } else if ("mode".equals(innerJsonName)) { sortMode = SortMode.fromString(parser.text()); } else if ("nested_path".equals(innerJsonName) || "nestedPath".equals(innerJsonName)) { nestedPath = parser.text();