Skip to content

Commit f9540f7

Browse files
authored
Implement SortOptionsVariant in FieldSort (#1323)
* Implement SortOptionsVariant in FieldSort Signed-off-by: Kosuke Suzuki <[email protected]> * Add change log Signed-off-by: Kosuke Suzuki <[email protected]> --------- Signed-off-by: Kosuke Suzuki <[email protected]>
1 parent fea4138 commit f9540f7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
5151
### Removed
5252

5353
### Fixed
54+
- Fixed an issue where `FieldSort` was not implementing `SortOptionsVariant` ([#1323](https://github.com/opensearch-project/opensearch-java/pull/1323))
5455

5556
### Security
5657

java-client/src/main/java/org/opensearch/client/opensearch/_types/FieldSort.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// typedef: _types.FieldSort
5050

5151
@JsonpDeserializable
52-
public class FieldSort implements PlainJsonSerializable {
52+
public class FieldSort implements SortOptionsVariant, PlainJsonSerializable {
5353
// Single key dictionary
5454
private final String field;
5555

@@ -94,6 +94,14 @@ public static FieldSort of(Function<Builder, ObjectBuilder<FieldSort>> fn) {
9494
return fn.apply(new Builder()).build();
9595
}
9696

97+
/**
98+
* SortOptions variant kind.
99+
*/
100+
@Override
101+
public SortOptions.Kind _sortOptionsKind() {
102+
return SortOptions.Kind.Field;
103+
}
104+
97105
/**
98106
* Required - The target field
99107
*/

0 commit comments

Comments
 (0)