It doesn't necessarily need to go through an XSLT but the idea remains the same. I want have the highest scores first no matter which result they match with.
So if the results are like this: <lst name="moreLikeThis"> <result name="3" numFound="2" start="0" maxScore="0.439"> <doc> <float name="score">0.439</float> <str name="id">1</str> </doc> <doc> <float name="score">0.215</float> <str name="id">2</str> </doc> <doc> <float name="score">0.115</float> <str name="id">3</str> </doc> </result> <result name="2" numFound="3" start="0" maxScore="0.539"> <doc> <float name="score">0.539</float> <str name="id">4</str> </doc> <doc> <float name="score">0.338</float> <str name="id">5</str> </doc> </result> </lst> I would want them to be formatted like this: <lst name="moreLikeThis"> <doc> <float name="score">0.539</float> <str name="id">4</str> </doc> <doc> <float name="score">0.439</float> <str name="id">1</str> </doc> <doc> <float name="score">0.338</float> <str name="id">5</str> </doc> <doc> <float name="score">0.215</float> <str name="id">2</str> </doc> <doc> <float name="score">0.115</float> <str name="id">3</str> </doc> </lst> The way I do it now is to fetch the results and then parse them with PHP to simulate that but it seems horribly inefficient so I'd like to do it within Solr if at all possible. On Thu, Mar 10, 2011 at 4:02 PM, Brian Lamb <brian.l...@journalexperts.com>wrote: > Any ideas on this one? > > > On Wed, Mar 9, 2011 at 2:00 PM, Brian Lamb > <brian.l...@journalexperts.com>wrote: > >> Hi all, >> >> I know that I can add &sort=score desc to the url to sort in descending >> order. However, I would like to sort a MoreLikeThis response which returns >> records like this: >> >> <lst name="moreLikeThis"> >> <result name="3" numFound="113611" start="0" maxScore="0.4392774"> >> <result name="2" numFound="1111" start="0" maxScore="0.5392774"> >> </lst> >> >> I don't want them grouped by result; I would just like have them all >> thrown together and then sorted according to score. I have an XSLT which >> does put them altogether and returns the following: >> >> <moreLikeThis> >> <similar> >> <score>x.xxxx</score> >> <id>some_id</id> >> </similar> >> </moreLikeThis> >> >> However it appears that it basically applies the stylesheet to result >> name="3" then result name="2". >> >> How can I make it so that with my XSLT, the results appear sorted by >> <score>? >> > >