Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SortOptionsVariant in FieldSort #1323

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// typedef: _types.FieldSort

@JsonpDeserializable
public class FieldSort implements PlainJsonSerializable {
public class FieldSort implements SortOptionsVariant, PlainJsonSerializable {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks like a miss, thanks @suzuki764 !

// Single key dictionary
private final String field;

Expand Down Expand Up @@ -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
*/
Expand Down
Loading