Sort items having the same score by date

Hello ,
I need to sort items that matched having same score by a date field .
This an example of the query

"sort" : [
"_score",
{ "searchDate" : {"order" : "desc" } }
]

This works perfectly .
Now i want to convert this to java code and here is my code :

querySourceBuilder.sort("_score", SortOrder.DESC).sort(SEARCH_DATE_FIELD,SortOrder.DESC);

but it's sorting all only by date .

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.