# How to aggregate frequency count of words which exist in a field

**URL:** <https://discuss.elastic.co/t/how-to-aggregate-frequency-count-of-words-which-exist-in-a-field/283931>\
**Category:** Elasticsearch\
**Created:** [September 11, 2021, 8:06am UTC](https://discuss.elastic.co/t/how-to-aggregate-frequency-count-of-words-which-exist-in-a-field/283931 "2021-09-11T08:06:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pooya\_Pilechi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pooya_pilechi/32/78636_2.png) [@Pooya\_Pilechi](https://discuss.elastic.co/u/Pooya_Pilechi)\
**Post date:** [September 11, 2021, 8:06am UTC](https://discuss.elastic.co/t/how-to-aggregate-frequency-count-of-words-which-exist-in-a-field/283931/1 "2021-09-11T08:06:56Z")

</div>

Hi.  
I want to evaluate frequency of terms which exist in a hashtags field of a twitter data.  
for example i have an index which its name is twitter .  
in twitter index i have a field which its name is hashtags.  
for instance in twitter index:

```auto
"took" : 2,
 "timed_out" : false,
 "_shards" : {
   "total" : 1,
   "successful" : 1,
   "skipped" : 0,
   "failed" : 0
 },
 "hits" : {
   "total" : {
     "value" : 1,
     "relation" : "eq"
   },
   "max_score" : 1.0,
   "hits" : [
     {
       "_index" : "twitter",
       "_type" : "_doc",
       "_id" : "1",
       "_score" : 1.0,
       "_source" : {
         "created_at" : "Sat Sep 04 10:03:08 +0000 2021",
       "entities" : {
           "hashtags" : [
             "sea",
             "water",
             "fish",
             "sea",
             "salt",
             "water",
             "Ice",
             "fish",
             "fish"

```

so i want a result which it could show me the following format:  
fish :3  
ice:1  
water:2  
sea:2  
salt:1

---

<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:** [September 13, 2021, 2:45pm UTC](https://discuss.elastic.co/t/how-to-aggregate-frequency-count-of-words-which-exist-in-a-field/283931/2 "2021-09-13T14:45:20Z")

</div>

See [Terms aggregation | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/search-aggregations-bucket-terms-aggregation.html)

---

<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:** [October 11, 2021, 2:46pm UTC](https://discuss.elastic.co/t/how-to-aggregate-frequency-count-of-words-which-exist-in-a-field/283931/3 "2021-10-11T14:46:06Z")

</div>

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