I've not tried this myself, but you'll need to do something along the  
lines of:
   has "CAST(AVG(item_ratings.rating) as unsigned)", :as  
=> :item_rating,
     :facet => true, :type => :integer
   has item_ratings(:id), :as => :item_ratings_ids # to ensure join  
exists

-- 
Pat

On 20/08/2009, at 4:24 PM, mrmanishs wrote:

>
> I want to get average ratings for an item for facets, how do I do
> this?
>
> Example pseudo code:
> Currently:
>    has item_ratings(:rating), :as => :item_rating, :facet => true
>
> Would llike something like:
>    has item_ratings(:rating).average.to_i, :as
> => :item_rating, :facet => true
>
>
> Thanks!
>
> Manish
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to