I have written a small search application and have used the addSort()
method for sorting the results. What I want to do is first sort the results
based on its score and if the score is same then it should sort it based on
a field which I have indexed. The code is as below
SearchResponse response =
where "scoreSort" is a "ScoreSortBuilder" object.
I get the desired result if I use only one sort i.e either sorting on score
or on the field. But when I use "addSort()" twice i.e first on score and
then on field, I don't get the desired result. It is not sorting based on
the "field" if the score is same.
Can anyone suggest what I might be doing wrong here? Any help would be