UserRating
define_index do
  indexes product.name
  has rating, user_id
end

On Jun 10, 2:21 am, kc <[email protected]> wrote:
> Hello,
>
> Im new to sphinx and would appreciate some help understanding how to
> do the following:
>
> Lets say I have a Product model.
> Product has many UserRatings.
> UserRatings belong to Products and Users.
>
> Id like to index Product name.  When I search, Id like to get all
> Products, sorted by the UserRating for a single user I pass in.  How
> would I do this?  Im assuming that if I have 2 attributes, specifying
> a :with on User and an :order on UserRating wont work...or does sphinx
> somehow maintain that association of a UserRating to a User?
>
> From the code, it looked like I might be able to have an attribute
> that is an array of 2 columns, like you can with indexes, but I don't
> see mention of that anywhere.  Nor do I understand how to write the
> query if you can do that.
>
> Any help would be appreciated.
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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