# Elasticsearch aggregation return location

**URL:** <https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179>\
**Category:** Elasticsearch\
**Created:** [May 28, 2019, 7:56pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179 "2019-05-28T19:56:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliuFlorez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliuflorez/32/40884_2.png) [@EliuFlorez](https://discuss.elastic.co/u/EliuFlorez)\
**Post date:** [May 28, 2019, 7:56pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179/1 "2019-05-28T19:56:02Z")

</div>

Hi guys, a query on aggregation in which way I can return the location in the aggregation result. to then place it on the maps.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 29, 2019, 7:14am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179/2 "2019-05-29T07:14:09Z")

</div>

can you be more specific on what you are after? What should this location resemble? Why do you need an aggregation instead of a search hit? There are a couple of geo based aggregations, so maybe you can explain why those are not sufficient. Some more context would help a lot to understand what you are after.

Thanks!

--Alex

---

<div class="post-metadata">

**Author:** ![EliuFlorez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliuflorez/32/40884_2.png) [@EliuFlorez](https://discuss.elastic.co/u/EliuFlorez)\
**Post date:** [May 29, 2019, 2:03pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179/3 "2019-05-29T14:03:18Z")

</div>

Hello, if I just see that with geo centroid I can return the location but make a count of it. What I would like is that it was only the result of the consultation plus 100 locations apart.

**Example**

```auto
...
"location" : {
   "lat" : 20,
   "lon" : -56
},
"location" : {
   "lat" : 20,
   "lon" : -66
}
...

```

but in aggregation

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 26, 2019, 2:03pm UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-return-location/183179/4 "2019-06-26T14:03:28Z")

</div>

Closed on June 26, 2019, 2:03pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
