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

ScoreSort sort by Doc field #561

Open
michalAndrzejKalinowskiEstimate opened this issue Apr 24, 2023 · 2 comments · May be fixed by mychalvlcek/elasticsearch-java#1 or #726
Open

ScoreSort sort by Doc field #561

michalAndrzejKalinowskiEstimate opened this issue Apr 24, 2023 · 2 comments · May be fixed by mychalvlcek/elasticsearch-java#1 or #726

Comments

@michalAndrzejKalinowskiEstimate

Java API client version

7.17

Java version

jdk8

Elasticsearch Version

7.17

Problem description

Seems like ScoreSort sort by doc field - see https://github.com/elastic/elasticsearch-java/blob/7.17/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java#L69
Probably it should be

public SortOptions.Kind _sortOptionsKind() {
        return SortOptions.Kind.Score;
}
@mychalvlcek
Copy link

so possible workarround, instead of using

SortOptionsBuilders.score().order(SortOrder.Desc).build();

use

SortOptions.of(so -> so.score(s -> s.order(SortOrder.Desc)))

@jerryguowei
Copy link

This is not only for 7.17. It occurs on 8 as well, I am using the latest 8.13.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants