Remove `sort_order` and `sort_mode` in favor of `order` and `mode`
Closes #2781
This commit is contained in:
parent
33608c333f
commit
e0eff7d9d3
|
@ -127,7 +127,7 @@ public class FieldSortBuilder extends SortBuilder {
|
||||||
builder.field("ignore_unmapped", ignoreUnampped);
|
builder.field("ignore_unmapped", ignoreUnampped);
|
||||||
}
|
}
|
||||||
if (sortMode != null) {
|
if (sortMode != null) {
|
||||||
builder.field("sort_mode", sortMode);
|
builder.field("mode", sortMode);
|
||||||
}
|
}
|
||||||
if (nestedFilter != null) {
|
if (nestedFilter != null) {
|
||||||
builder.field("nested_filter", nestedFilter, params);
|
builder.field("nested_filter", nestedFilter, params);
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class SortParseElement implements SearchParseElement {
|
||||||
} else if (token.isValue()) {
|
} else if (token.isValue()) {
|
||||||
if ("reverse".equals(innerJsonName)) {
|
if ("reverse".equals(innerJsonName)) {
|
||||||
reverse = parser.booleanValue();
|
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())) {
|
if ("asc".equals(parser.text())) {
|
||||||
reverse = SCORE_FIELD_NAME.equals(fieldName);
|
reverse = SCORE_FIELD_NAME.equals(fieldName);
|
||||||
} else if ("desc".equals(parser.text())) {
|
} else if ("desc".equals(parser.text())) {
|
||||||
|
@ -146,7 +146,7 @@ public class SortParseElement implements SearchParseElement {
|
||||||
missing = parser.textOrNull();
|
missing = parser.textOrNull();
|
||||||
} else if ("ignore_unmapped".equals(innerJsonName) || "ignoreUnmapped".equals(innerJsonName)) {
|
} else if ("ignore_unmapped".equals(innerJsonName) || "ignoreUnmapped".equals(innerJsonName)) {
|
||||||
ignoreUnmapped = parser.booleanValue();
|
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());
|
sortMode = SortMode.fromString(parser.text());
|
||||||
} else if ("nested_path".equals(innerJsonName) || "nestedPath".equals(innerJsonName)) {
|
} else if ("nested_path".equals(innerJsonName) || "nestedPath".equals(innerJsonName)) {
|
||||||
nestedPath = parser.text();
|
nestedPath = parser.text();
|
||||||
|
|
Loading…
Reference in New Issue