# Is there a way to accumulate the count of given word(s) in a standard indexed field?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-accumulate-the-count-of-given-word-s-in-a-standard-indexed-field/138113>\
**Category:** Elasticsearch\
**Created:** [July 2, 2018, 3:34am UTC](https://discuss.elastic.co/t/is-there-a-way-to-accumulate-the-count-of-given-word-s-in-a-standard-indexed-field/138113 "2018-07-02T03:34:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdavids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sdavids/32/32847_2.png) [@sdavids](https://discuss.elastic.co/u/sdavids)\
**Post date:** [July 2, 2018, 3:34am UTC](https://discuss.elastic.co/t/is-there-a-way-to-accumulate-the-count-of-given-word-s-in-a-standard-indexed-field/138113/1 "2018-07-02T03:34:59Z")

</div>

We would like to provide customers the ability to enter keywords and get a date histogram driven chart which tracks both the amount of documents that it hit (straight forward) and how many times that particular keyword was used across all of the documents for that time segment. i.e. given the words "cat" and "dog" we may have a document hit histogram of:

January:  
cat: 30  
dog: 50  
February:  
cat: 80  
dog: 20  
March:  
cat: 75  
dog: 60

We would also like to see how many times those keywords show up in the given document field (accumulated term frequency):

January:  
cat: 60  
dog: 500  
February:  
cat: 125  
dog: 65  
March:  
cat: 400  
dog: 120

I'm not seeing anything obvious from the API in order to achieve the later use-case. Any tips or tricks would be greatly appreciated.

---

<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:** [July 30, 2018, 3:41am UTC](https://discuss.elastic.co/t/is-there-a-way-to-accumulate-the-count-of-given-word-s-in-a-standard-indexed-field/138113/2 "2018-07-30T03:41:59Z")

</div>

Closed on July 30, 2018, 3:41am UTC

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