Skip to content

Support sort _score/_doc order shorthand#2002

Open
russcam wants to merge 1 commit into
opensearch-project:mainfrom
russcam:bugfix-sort-shorthand
Open

Support sort _score/_doc order shorthand#2002
russcam wants to merge 1 commit into
opensearch-project:mainfrom
russcam:bugfix-sort-shorthand

Conversation

@russcam

@russcam russcam commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds support for the shorthand version of _score and _doc sort order of the form:

{"_score": "desc"}

This currently throws a JSON parsing exception, but is a valid form. This form may be generated from another system and deserialized using the java client.

Issues Resolved

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

This commit adds support for the shorthand version of _score and _doc
sort order of the form:

{"_score": "desc"}

@reta reta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@russcam we would really need to stick to API specification (or update API specification with the shortcut form first), thank you

[1] https://github.com/opensearch-project/opensearch-api-specification/blob/main/spec/schemas/_common.yaml#L669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants