Hi Pat,

Shouldn't it be "has 'RADIANS(table_name.field_name)'" and not "has
'RADIANS(association_name.field_name)'"?

In the example the location table is probably named 'locations' if
following ActiveRecord conventions.

so:

  has location(:id), :as => :location_id
  has 'RADIANS(locations.lat)', :as => :lat, :type => :float
  has 'RADIANS(locations.lng)', :as => : lng, :type => :float

Thanks - JW

> Firstly, you'll need to ensure the association is referenced somewhere  
> in your index setup:
>    has location(:id), :as => :location_id
>
> And then you can add custom SQL snippets for generating lat and lng in  
> radians:
>    has 'RADIANS(location.lat)', :as => :lat, :type => :float
>    has 'RADIANS(location.lng)', :as => :lng, :type => :float

--~--~---------~--~----~------------~-------~--~----~
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