Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SortOptionsVariant in FieldSort (opensearch-project#1323)
Browse files Browse the repository at this point in the history
* 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]>
(cherry picked from commit f9540f7)
suzuki764 committed Nov 25, 2024
1 parent 334864e commit cd98a93
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed
- Fixed `IcuCollationDecomposition`'s variants to align with those supported by OpenSearch ([#]())
- Fixed an issue where `FieldSort` was not implementing `SortOptionsVariant` ([#1323](https://github.com/opensearch-project/opensearch-java/pull/1323))

### Security

Original file line number Diff line number Diff line change
@@ -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<Builder, ObjectBuilder<FieldSort>> fn) {
return fn.apply(new Builder()).build();
}

/**
* SortOptions variant kind.
*/
@Override
public SortOptions.Kind _sortOptionsKind() {
return SortOptions.Kind.Field;
}

/**
* Required - The target field
*/

0 comments on commit cd98a93

Please sign in to comment.