# Find word count in text field

**URL:** <https://discuss.elastic.co/t/find-word-count-in-text-field/288120>\
**Category:** Elasticsearch\
**Created:** [November 1, 2021, 8:44am UTC](https://discuss.elastic.co/t/find-word-count-in-text-field/288120 "2021-11-01T08:44:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjaye218](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sanjaye218](https://discuss.elastic.co/u/sanjaye218)\
**Post date:** [November 1, 2021, 8:44am UTC](https://discuss.elastic.co/t/find-word-count-in-text-field/288120/1 "2021-11-01T08:44:28Z")

</div>

Hi,  
I am trying to get top 10 words along with word count in text field in multiple documents based on certain filter criteria. I can see termvector but its giving results per document.

e.g. document 1 contains comments field "test vector" & document 2 contains comments = "test API", so I am expecting result like test=2, vector=1, API=1

Appreciate any help.

Regards,  
Sanjay

---

<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:** [November 29, 2021, 8:45am UTC](https://discuss.elastic.co/t/find-word-count-in-text-field/288120/2 "2021-11-29T08:45:19Z")

</div>

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