Hi JW You're right, it should be table name. Was this a suggestion from an email? Or documentation somewhere that I need to fix?
-- Pat On 03/09/2009, at 6:13 PM, J. W. wrote: > > 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 -~----------~----~----~----~------~----~------~--~---
