# Count text fields from aggregation

**URL:** <https://discuss.elastic.co/t/count-text-fields-from-aggregation/171993>\
**Category:** Elasticsearch\
**Created:** [March 12, 2019, 3:52pm UTC](https://discuss.elastic.co/t/count-text-fields-from-aggregation/171993 "2019-03-12T15:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gguman](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gguman](https://discuss.elastic.co/u/gguman)\
**Post date:** [March 12, 2019, 3:52pm UTC](https://discuss.elastic.co/t/count-text-fields-from-aggregation/171993/1 "2019-03-12T15:52:13Z")

</div>

Hi to all!

I have a query and some aggregation on it. And I want to count text fields inside the aggregation result. How I can do it without changing structure and mapping of the fields?

query: aggs(field:keyword): count (field:text)

Regards,  
G

---

<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:** [April 9, 2019, 3:52pm UTC](https://discuss.elastic.co/t/count-text-fields-from-aggregation/171993/2 "2019-04-09T15:52:19Z")

</div>

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