Answer the question
In order to leave comments, you need to log in
Elasticsearch geohash - how to get data that has been aggregated?
Hello.
Aggregating geo_point points using GeoHash grid Aggregation.
I get GeoHash and the number of points that are aggregated in it.
The question is how to get a list of points that are aggregated within a specific GeoHash?
Sending a request to get a GeoHash.
{
"aggregations": {
"filter_agg": {
"filter": {
"geo_bounding_box": {
"ignore_unmapped": true,
"location": {
"top_left": "41.098804663542325,49.355824553713035",
"bottom_right": "39.99393061395733,50.19470905400232"
}
}
},
"aggregations": {
"data": {
"geohash_grid": {
"field": "location",
"precision": "6"
},
"aggregations": {
"info": {
"geo_centroid": {
"field": "location"
}
}
}
}
}
}
},
"size": 0
}
{
"key": "tp5mwz",
"doc_count": 734,
"info": {
"location": {
"lat": 40.382942053957585,
"lon": 49.87214530620226
},
"count": 734
}
},
{
"key": "tp5my0",
"doc_count": 583,
"info": {
"location": {
"lat": 40.38779562121931,
"lon": 49.841050580463424
},
"count": 583
}
}
Answer the question
In order to leave comments, you need to log in
You will need to make another request, already with aggregation parameters. Then get your points, everything, without a trace.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question