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
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
appreciated.
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
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
appreciated.
But that does not work... until I remove .missing("_last") from the two
sorts. Then it stops failing.
Den tirsdag den 3. juli 2012 18.21.07 UTC+2 skrev kimchy:
It should work, can you post a recreation showing that it does not work?
On Tue, Jul 3, 2012 at 3:59 PM, Harsh <harsh.c...@gmail.com <javascript:>>wrote:
Hello,
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
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
appreciated.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.