From 0ee9a52a7e0a1bae72d1c503322b90191f092f2e Mon Sep 17 00:00:00 2001 From: Kosuke Suzuki Date: Sat, 23 Nov 2024 23:57:27 +0900 Subject: [PATCH 1/2] Implement SortOptionsVariant in FieldSort Signed-off-by: Kosuke Suzuki --- .../opensearch/client/opensearch/_types/FieldSort.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/FieldSort.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/FieldSort.java index b25f46697f..80de282ada 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/FieldSort.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/FieldSort.java @@ -49,7 +49,7 @@ // typedef: _types.FieldSort @JsonpDeserializable -public class FieldSort implements PlainJsonSerializable { +public class FieldSort implements SortOptionsVariant, PlainJsonSerializable { // Single key dictionary private final String field; @@ -94,6 +94,14 @@ public static FieldSort of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * SortOptions variant kind. + */ + @Override + public SortOptions.Kind _sortOptionsKind() { + return SortOptions.Kind.Field; + } + /** * Required - The target field */ From a5fb619c395ce0e2764635fb94108eb4b5f544ee Mon Sep 17 00:00:00 2001 From: Kosuke Suzuki Date: Sun, 24 Nov 2024 00:20:01 +0900 Subject: [PATCH 2/2] Add change log Signed-off-by: Kosuke Suzuki --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48028906d1..87ad525497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Removed ### Fixed +- Fixed an issue where `FieldSort` was not implementing `SortOptionsVariant` ([#1323](https://github.com/opensearch-project/opensearch-java/pull/1323)) ### Security