[Prev] Thread [Next]  |  [Prev] Date [Next]

[ts] Re: Geo Search With Multiple Locations Pat Allan Tue Feb 24 17:00:41 2009

Hi Thuva

You're general approach is spot on - but the problem is Sphinx itself  
does not handle multiple-value-attributes with floats, only integers,  
so it's not going to handle those columns as it should. In short, I'm  
not sure how you can get the result you want.

Sorry I can't be more help


On 25/02/2009, at 9:58 AM, Thuva Tharma wrote:

> I have the following model set up:
> class Business
>   has_many :locations
> end
> class Location
>   belongs_to :business
> end
> Location has latitude and longitude values as radians. I would like to
> "geo search" across all the locations when I do Business.search. Is
> this possible? If so, can you show me how to do the define_index in
> Business class? I'm thinking of something like:
> define_index do
>   indexes locations.lat, :as => :latit
>   indexes locations.lng, :as => :longit
> end
> Please let me know if I'm in the right direction.
> Thank you in advance.
> -- Thuva
> >

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