Hi Benjamin
Sorry, the error message is a little cryptic - it means that in your Bar index,
you need an attribute for the foreign key:
has foo_id
That way, the search can limit results to bars that are tied to the given foo.
Cheers
--
Pat
On 16/07/2011, at 1:18 AM, Benjamin Moses Lieb wrote:
> I have thousands of Foos, each of which can have hundreds of Bars.
>
> I would like to do foo.bars.search('string'), but this gives me an
> error: Missing Attribute for Foreign Key foo_id
>
> Apparently I need an actual scope, and not an association for this to
> work. What is the simplest solution to be able to search through a
> model's has_many associations?
>
> 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.
>
--
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.