Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ES 5.x JAVA API SortBuilder throws an exception. #22075
Elasticsearch version: 5.1.1
Plugins installed: 
JVM version: 1.8.0_74
Description of the problem including expected versus actual behavior:
Since ES 5.0 we have an issue when using sortBuilders from java API.
The sort was on _sort field.
Steps to reproduce:
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