elasticsearch6.4.3之GeoHash网格聚合

es6.4.3之GeoHash grid Aggregation(GeoHash网格聚合)

GeoHash网格聚合

你好! es地理点聚合,花了半天时间搞定了,供大家分享一下。

elasticsearch6.4.3之GeoHash网格聚合

#ok
PUT museums2
{
“settings”:{
“number_of_shards”:1,
“number_of_replicas”:0
},
“mappings”:{
“museums”: {
“properties”: {
“location”: {“type”: “geo_point”}
}
}
}
}

DELETE museums

PUT /museums2
{
“mappings”: {
“doc”: {
“properties”: {
“location”: {
“type”: “geo_point”
}
}
}
}
}

POST /museums2/doc/_bulk?refresh
{“index”:{"_id":1}}
{“location”: “52.374081,4.912350”, “name”: “NEMO Science Museum”}
{“index”:{"_id":2}}
{“location”: “52.369219,4.901618”, “name”: “Museu

你可能感兴趣的:(elasticsearch,java)