You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by PeterKerk <ve...@hotmail.com> on 2010/12/23 00:01:25 UTC

Sorting results on MULTIPLE fields, not showing expected order

I want to sort results as follows
- highest membervalue (float) on top.
- within those results I want to sort the items that share the same position
on the user rating (integer), once again, highest rating on top
- and within those results I want to sort the items that share the same
position on the fact if they have a photo (bit)


Now I have this:
&fq=themes:%22Boat%20and%20Water%22&sort=hasphoto%20desc&q=*:*&fl=id,title

I see the correct item on top.

But when I have the full query:
&fq=themes:%22Boat%20and%20Water%22&sort=membervalue
%20desc&sort=location_rating%20desc&sort=hasphoto%20desc&q=*:*&fl=id,title

An item appears on top that has:
membervalue=0.00
location_rating=0
hasphoto=false

There are other location that have either a higher membervalue, a
locationrating or a photo. This location should NOT be on top. 
Why is this happening?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-results-on-MULTIPLE-fields-not-showing-expected-order-tp2133959p2133959.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting results on MULTIPLE fields, not showing expected order

Posted by PeterKerk <ve...@hotmail.com>.
Wow, you're fast :)
But that indeed did the trick, thanks!
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Sorting-results-on-MULTIPLE-fields-not-showing-expected-order-tp2133959p2134000.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Sorting results on MULTIPLE fields, not showing expected order

Posted by Ahmet Arslan <io...@yahoo.com>.
--- On Thu, 12/23/10, PeterKerk <ve...@hotmail.com> wrote:

> From: PeterKerk <ve...@hotmail.com>
> Subject: Sorting results on MULTIPLE fields, not showing expected order
> To: solr-user@lucene.apache.org
> Date: Thursday, December 23, 2010, 1:01 AM
> 
> I want to sort results as follows
> - highest membervalue (float) on top.
> - within those results I want to sort the items that share
> the same position
> on the user rating (integer), once again, highest rating on
> top
> - and within those results I want to sort the items that
> share the same
> position on the fact if they have a photo (bit)
> 
> 
> Now I have this:
> &fq=themes:%22Boat%20and%20Water%22&sort=hasphoto%20desc&q=*:*&fl=id,title
> 
> I see the correct item on top.
> 
> But when I have the full query:
> &fq=themes:%22Boat%20and%20Water%22&sort=membervalue
> %20desc&sort=location_rating%20desc&sort=hasphoto%20desc&q=*:*&fl=id,title
> 
> An item appears on top that has:
> membervalue=0.00
> location_rating=0
> hasphoto=false
> 
> There are other location that have either a higher
> membervalue, a
> locationrating or a photo. This location should NOT be on
> top. 
> Why is this happening?


"Multiple sort orderings can be separated by a comma, ie: sort=<field name>+<direction>[,<field name>+<direction>]..." [1]

[1]http://wiki.apache.org/solr/CommonQueryParameters#sort