Open heyibo8888 opened 7 years ago
使用ES方式查询时可以使用 curl -XGET "http://localhost:9200/logstash-park/jdbc/_search" -H 'Content-Type: application/json' -d' { "query": { "geo_distance": { "distance": "3km", "geo": { "lat": 28.233971, "lon": 112.945333 } } }, "sort": [ { "_geo_distance": { "geo": { "lat": 28.233971, "lon": 112.945333 }, "order": "asc", "unit": "km", "distance_type": "plane" } } ] }' 改成使用elasticsearch-sql 后 SELECT * FROM logstash-park/jdbc where GEO_DISTANCE(geo, '3km', 112.945333, 28.233971) 可以正常返回 但无法按照距离进行排序
使用ES方式查询时可以使用 curl -XGET "http://localhost:9200/logstash-park/jdbc/_search" -H 'Content-Type: application/json' -d' { "query": { "geo_distance": { "distance": "3km", "geo": { "lat": 28.233971, "lon": 112.945333 } } }, "sort": [ { "_geo_distance": { "geo": { "lat": 28.233971, "lon": 112.945333 }, "order": "asc", "unit": "km", "distance_type": "plane" } } ] }' 改成使用elasticsearch-sql 后 SELECT * FROM logstash-park/jdbc where
GEO_DISTANCE(geo, '3km', 112.945333, 28.233971) 可以正常返回 但无法按照距离进行排序