opensearch-project / opensearch-project/opensearch-java

[BUG] ScoreSort returns SortOptions.Kind.Doc

Open
#1,492 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

What is the bug?

When creating a ScoreSort it ends up behaving as _doc sort because the kind of ScoreSort is SortOptions.Kind.Doc

How can one reproduce the bug?
SortOptionsBuilders.score().build()._sortOptionsKind() // == _doc
What is the expected behavior?
SortOptionsBuilders.score().build()._sortOptionsKind() // == _score
What is your host/environment?

Windows 10

Do you have any screenshots?

Image

Do you have any additional context?

https://github.com/opensearch-project/opensearch-java/blob/eab40918d52a10a664bec1c2e488f3a6829d24a9/java-client/src/main/java/org/opensearch/client/opensearch/_types/ScoreSort.java#L69-L72

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open java-client/src/main/java/org/opensearch/client/opensearch/_types/ScoreSort.java around lines 69-72 and inspect how ScoreSort reports its sort kind. Reproduce the issue with SortOptionsBuilders.score().build()._sortOptionsKind(); done means it returns _score rather than _doc.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.