# Deriving the total term frequency for each term

**URL:** <https://discuss.elastic.co/t/deriving-the-total-term-frequency-for-each-term/239952>\
**Category:** Elasticsearch\
**Created:** [July 6, 2020, 4:02am UTC](https://discuss.elastic.co/t/deriving-the-total-term-frequency-for-each-term/239952 "2020-07-06T04:02:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![richylyq](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@richylyq](https://discuss.elastic.co/u/richylyq)\
**Post date:** [July 6, 2020, 4:02am UTC](https://discuss.elastic.co/t/deriving-the-total-term-frequency-for-each-term/239952/1 "2020-07-06T04:02:54Z")

</div>

I would like to check on how to derive the total term frequency for each term; where and how should i do the summation of term\_freq for each document?

> [@Elasticsearch: total term frequency and doc count from given set of documents](https://discuss.elastic.co/t/elasticsearch-total-term-frequency-and-doc-count-from-given-set-of-documents/115223/5):
>
> 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.

---

<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:** [August 3, 2020, 4:03am UTC](https://discuss.elastic.co/t/deriving-the-total-term-frequency-for-each-term/239952/2 "2020-08-03T04:03:02Z")

</div>

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