define_index do
        indexes :name, :sortable => true

        indexes address.city, :as => :city

        has created_at, updated_at

                     has 'RADIANS(addresses.lat)', :as
=> :latitude,  :type => :float
        has 'RADIANS(addresses.lng)',:as => :longitude, :type
=> :float

        set_property :latitude_attr   => "latitude"
        set_property :longitude_attr  => "longitude"

    end


On May 30, 5:38 pm, Pat Allan <[email protected]> wrote:
> What does your define_index block look like in your Store model?
>
> --
> Pat
>
> On 31/05/2010, at 6:53 AM, badnaam wrote:
>
> > I am trying to do a proximity search like..
>
> > l = (Geokit::Geocoders::GoogleGeocoder.geocode 'xxxxx').ll
>
> > la = Address.get_radian(l[0], l[1])
>
> > def self.get_radian(lat, lng)
> >        return [(lat / 180.0) * Math::PI, (lng / 180.0) * Math::PI]
> >    end
>
> > Store.search("green", :geo => la, :with => {"@geodist" =>
> > 0.0..50_000.0})
>
> > This returns no results, I know it should return some records, and it
> > does if I take the @geodist out, what am I doing wrong here?
>
> > Thanks
>
> > --
> > 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 
> > athttp://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.

Reply via email to