Try the following:
Parking.search 'public',
:geo => [@location.latitude, @location.longitude],
:order => "@geodist ASC, @relevance DESC"
Cheers
--
Pat
On 15/02/2011, at 7:05 AM, wvuzero wrote:
> Rails 1.2.3, Ruby 1.8.6
> Thinking Sphinx v1.4.3
> Sphinx 0.9.9-release (r2117)
>
> Having an issue trying to figure out the configuration for Geo
> Location searching.
>
> In my indexes i have:
>
> has "RADIANS(locations.latitude)", :as => :latitude, :type
> => :float
> has "RADIANS(locations.longitude)", :as => :longitude, :type
> => :float
>
> My search is:
>
> Parking.search 'public', :latitude => @location.latitude, :longitude
> =>@location.longitude, :order => "@geodist ASC, @relevance DESC"
>
> The message I get returned is:
>
> index location_core: sort-by attribute '@geodist' not found
>
> I can get a normal search to return results just fine. However trying
> to use the geodist I receive this error. I have rebuilt the index
> several times and can not seem to get around this problem.
>
> If anyone can point me in the right direction I would appreciate it.
> Still new under the collar to sphinx & thinkingsphinx, a lot to take
> in but so far a very cool and useful tool.
>
> --
> 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.