我希望能够列出1000个结果,但我被限制在20,因为ASC限制与宝石思维斯芬克斯。
如何将ASC限制提高到0,20到0,1000?
SELECT GEODIST(0.5904448859496816, -1.464156709498043, latitude, longitude) AS geodist, *
FROM `location_core`
WHERE `geodist` BETWEEN 0.0 AND 200000.0 AND `sphinx_deleted` = 0
ORDER BY `geodist` ASC
LIMIT 0, 20这是我必须用MYSQL修改的东西吗?
主计长:
def index
location = Location.find_by_zipcode params[:zipcode]
latitude = location.latitude * Math::PI / 180
longitude = location.longitude * Math::PI / 180
location_ids = Location.search_for_ids(
:geo => [latitude, longitude],
:with => {:geodist => 0.0..200_000.0}
)
@users = User.where(:location_id => location_ids)
end发布于 2014-01-27 15:05:30
ASC 0,20很好。
变化
:geo => [latitude, longitude],
:with => {:geodist => 0.0..200_000.0}至
:geo => [latitude, longitude],
:with => {:geodist => 0.0..200_000.0},
:per_page => 1_000https://stackoverflow.com/questions/21338426
复制相似问题