# Elasticsearch: total term frequency and doc count from given set of documents

**URL:** <https://discuss.elastic.co/t/elasticsearch-total-term-frequency-and-doc-count-from-given-set-of-documents/115223>\
**Category:** Elasticsearch\
**Created:** [January 12, 2018, 6:17am UTC](https://discuss.elastic.co/t/elasticsearch-total-term-frequency-and-doc-count-from-given-set-of-documents/115223 "2018-01-12T06:17:24Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jimczi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimczi/32/47985_2.png) [@jimczi](https://discuss.elastic.co/u/jimczi)\
**Post date:** [January 12, 2018, 8:36am UTC](https://discuss.elastic.co/t/elasticsearch-total-term-frequency-and-doc-count-from-given-set-of-documents/115223/5 "2018-01-12T08:36:48Z")

</div>

Since you have the `term_freq` per term per document in the response, it should be straightforward to derive the total term frequency for each term (just sum up the `term_freq` of each document/term) and the doc count is just the number of documents in the response that contain the term.

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-total-term-frequency-and-doc-count-from-given-set-of-documents/115223)._
