Answer the question
In order to leave comments, you need to log in
How to group data by geo-coordinates in Elasticsearch and get _source in each area?
Elasticsearch allows you to group data by area using GeoHash grid Aggregation
But I still need to get one document from each area. (Similar to MySQL's GROUP BY.)
How can I do this without having to query each area?
Answer the question
In order to leave comments, you need to log in
Use top_hits inside the aggregation:
https://www.elastic.co/guide/en/elasticsearch/refe...
`sort` specifies a parameter that will serve as the calculation of max and document selection.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question