Hi Patrick
You need to add this to the index definition - Sphinx does not use SQL for its
search queries, so any ActiveRecord scoping is ignored.
Cheers
--
Pat
On 20/06/2012, at 6:44 PM, patrick99e99 wrote:
> I've got the following code:
>
> User.search(:geo => [location.lat.to_radians,
> location.lng.to_radians], :order => "@geodist ASC", :without =>
> { :latitude => 0.0 })
>
> But I wanted to do something like
>
> User.where("user_attributes.active IS
> true").joins(:user_attributes).search(:geo =>
> [location.lat.to_radians, location.lng.to_radians], :order =>
> "@geodist ASC", :without => { :latitude => 0.0 })
>
> But sphinx seems to ignore the previous scoping.. Is there a way to
> do this from within the search method? Or is this something that has
> to be added to the index?
>
> -patrick
>
> --
> 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.