ElasticSearch根据经纬度实现点聚合
{
"query": {
"bool": {
"should":
[
{"match":{"字段a":"条件内容a"}},
{"match":{"字段a":"条件内容b"}},
{"match":{"字段b":"条件内容a"}}
]
"must":
[
{"match":{"字段a":"内容a"}},
{"match":{"字段a":"内容b"}},
{"match":{"字段b":"内容a"}}
]
}
},
"aggregations": {
"zoom-in": {
"filter": {
"geo_bounding_box": {
"lat_lon": {
"top_left": "31.226054,113.418764",
"bottom_right": "29.587454,115.046162",
}
}
},
"aggs": {
"areas": {
"geohash_grid": {
"field": "lat_lon",
"precision": 9
},
"aggs": {
"location": {
"geo_bounds": {
"field": "lat_lon"
}
}
}
}
}
}
}
}