Sorting results on MULTIPLE fields, not showing expected order

2010-12-22 Thread PeterKerk

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%22sort=hasphoto%20descq=*:*fl=id,title

I see the correct item on top.

But when I have the full query:
fq=themes:%22Boat%20and%20Water%22sort=membervalue
%20descsort=location_rating%20descsort=hasphoto%20descq=*:*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

2010-12-22 Thread Ahmet Arslan

--- On Thu, 12/23/10, PeterKerk vettepa...@hotmail.com wrote:

 From: PeterKerk vettepa...@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%22sort=hasphoto%20descq=*:*fl=id,title
 
 I see the correct item on top.
 
 But when I have the full query:
 fq=themes:%22Boat%20and%20Water%22sort=membervalue
 %20descsort=location_rating%20descsort=hasphoto%20descq=*:*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


  


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

2010-12-22 Thread PeterKerk

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.