# Geohash Aggregation Question

**URL:** <https://discuss.elastic.co/t/geohash-aggregation-question/257681>\
**Category:** Elasticsearch\
**Created:** [December 4, 2020, 5:02pm UTC](https://discuss.elastic.co/t/geohash-aggregation-question/257681 "2020-12-04T17:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnrodey](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@johnrodey](https://discuss.elastic.co/u/johnrodey)\
**Post date:** [December 4, 2020, 5:02pm UTC](https://discuss.elastic.co/t/geohash-aggregation-question/257681/1 "2020-12-04T17:02:04Z")

</div>

Is there a way to create a geohash aggregation with counts for subtypes/numeric ranges within that geohash. For example if I have a collection of buildings and I want to know for each geohash, what is the count of office, retail, and residential buildings. Or for each geohash I want to know the count of buildings within that area that have 1 floor, 2-3 floors, or 4+ floors.

Or would I need to execute 3 different requests to Elasticsearch to satisfy that need?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 4, 2020, 5:08pm UTC](https://discuss.elastic.co/t/geohash-aggregation-question/257681/2 "2020-12-04T17:08:11Z")

</div>

Hi John,  
Like other "bucket" aggregations, the geohash\_grid aggregation can nest child aggregations underneath to create sub-buckets. There's an example [here](https://www.elastic.co/blog/significant-terms-aggregation#geo) in this blog post.

---

<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:** [January 1, 2021, 5:08pm UTC](https://discuss.elastic.co/t/geohash-aggregation-question/257681/3 "2021-01-01T17:08:26Z")

</div>

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