Remove `sort_order` and `sort_mode` in favor of `order` and `mode`

Closes #2781
This commit is contained in:
Simon Willnauer 2013-03-15 13:55:35 +01:00
parent 33608c333f
commit e0eff7d9d3
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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();