- geo_distance:直线距离检索方式
- geo_bounding_bos:以两个点确定一个矩形,获取在矩形内的全部数据
- geo_polygon:以多个点,确定一个多边形,获取多边形内的全部数据
#测试geo--geo_distance POST /king_test_map/_search { "query": { "geo_distance":{ "location":{ #确定一个点 "lon":104.07551, "lat":30.543074 }, "distance":1000, #确定半径:m "distance_type":"arc" #指定形状为圆形 } } }
#测试geo--geo_bounding_box POST /king_test_map/_search { "query": { "geo_bounding_box":{ "location":{ "top_left":{ #左上角的坐标 "lon":104.056466, "lat":30.550103 }, "bottom_right":{ #右下角的坐标 "lon":104.074576, "lat":30.536418 } } } } }
#测试geo--geo_bounding_box POST /king_test_map/_search { "query": { "geo_polygon":{ "location":{ "points":[ { "lon":104.056394, "lat":30.55029 }, { "lon":104.06279, "lat":30.542079 }, { "lon":104.072348, "lat":30.546807 }, { "lon":104.067533, "lat":30.554333 } ] } } } }标签:box,distance,经纬度,lon,查询,bounding,elasticsearch,lat,geo From: https://www.cnblogs.com/wq-blogs/p/17998484