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
ES 5.x JAVA API SortBuilder throws an exception. #22075
Comments
Can you add the exception you are seeing and if possible also the java code you use when this happens? |
The exception is :
You can use this sample code to reproduce : `SearchRequestBuilder builder = client.prepareSearch("g_contents").setVersion(true);
|
@muteri the problem here is you are trying to sort on a field called "_score" which doesn't exist in your document (not the |
@cbuescher sorry for the delayed answer, you're right the issue was coming from "_score". With .scoreSort() everything works fine. Thanks a lot. |
Elasticsearch version: 5.1.1
Plugins installed: []
JVM version: 1.8.0_74
OS version:
Description of the problem including expected versus actual behavior:
Since ES 5.0 we have an issue when using sortBuilders from java API.
If we use Builder.addSort(SortBuilder) we got an error, if we replace by Builder.addSort(field, SortOrder) everything is fine.
In both case the generated json Query is the same and is working fine with sense. The issue seems only occurs from JAVA APi.
The sort was on _sort field.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: