#encoding: utf-8
#
#
#
# class User < ActiveRecord::Base has_secure_password
searchable do float :lat float :lng latlon :location end end
lat, lng = @current_user.lat, @current_user.lng result = User.search do order_by_geodist(:location, lat, lng, :desc) end
user 中有经纬度 lat 和 png, 返回的 result 结构为Sunspot::Search::fq={["type:User"], :sort=>"geodist(location_ll,34.2336,142.366) desc", :start=>0, :rows=>30, :q=>":"}>,获取 result.hits 则为空 []。求大神指点~~