# Count the number of phrase hits in a specific document

**URL:** <https://discuss.elastic.co/t/count-the-number-of-phrase-hits-in-a-specific-document/248572>\
**Category:** Elasticsearch\
**Created:** [September 14, 2020, 6:23pm UTC](https://discuss.elastic.co/t/count-the-number-of-phrase-hits-in-a-specific-document/248572 "2020-09-14T18:23:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderman4g63](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spyderman4g63/32/64172_2.png) [@spyderman4g63](https://discuss.elastic.co/u/spyderman4g63)\
**Post date:** [September 14, 2020, 6:23pm UTC](https://discuss.elastic.co/t/count-the-number-of-phrase-hits-in-a-specific-document/248572/1 "2020-09-14T18:23:33Z")

</div>

Is there a way to search for a document by id (\_doc) and then count the number of times a phrase is mentioned?

Given the text in a field called 'message': "Bob Smith is a plumber. Bob Smith is also a racecar driver. Bob Smith is not an elasticsearch expert".

Could I count Bob Smith (3) some how?

---

<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 12, 2020, 6:23pm UTC](https://discuss.elastic.co/t/count-the-number-of-phrase-hits-in-a-specific-document/248572/2 "2020-10-12T18:23:42Z")

</div>

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