Spring 加载时从数据库读取数据写入 redis ,使用命令行可以返回结果 geosearch project:locs fromlonlat 112.xx 32.xx BYRADIUS 200 km WITHDIST ASC
但在程序中始终结果为 0 ,请帮忙分析下是什么原因?
String key = "project:locs";
GeoResults<RedisGeoCommands.GeoLocation<String>> results = redisTemplate.opsForGeo().search(
key,
GeoReference.fromCoordinate(112.xx,32.xx),
new Distance(5000000, Metrics.KILOMETERS),
RedisGeoCommands.GeoSearchCommandArgs.newGeoSearchArgs().includeDistance().limit(100));
List<GeoResult<RedisGeoCommands.GeoLocation<String>>> content = results.getContent();