Application wide search using conditions

10 views
Skip to first unread message

Giovanni Sakti

unread,
Nov 23, 2009, 8:59:53 AM11/23/09
to Thinking Sphinx
Hi guys,
I'm new with thinking sphinx and i got stuck in implementing
application wide search with conditions.

for example i could do this when using model search:

User.search 'giovanni', :conditions => {:position => 'staff'}

But how can i use conditions for application wide search ?

ThinkingSphinx.search 'giovanni', :classes => [User, UserGroup]



Pat Allan

unread,
Nov 25, 2009, 12:08:38 AM11/25/09
to thinkin...@googlegroups.com
Hi Giovanni

If there are fields with the same name in both/all models, then you
can just use conditions in the same way as you would on a single model:

ThinkingSphinx.search 'giovanni',
:conditions => {:position => 'staff'},
:classes => [User, UserGroup]

Cheers

--
Pat
> --
>
> You received this message because you are subscribed to the Google
> Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=
> .
>
>

Reply all
Reply to author
Forward
0 new messages