# Counting the SEARCH term/phrase in a specific field

**URL:** <https://discuss.elastic.co/t/counting-the-search-term-phrase-in-a-specific-field/302107>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language, eql-elastic-query-language\
**Created:** [April 11, 2022, 1:49pm UTC](https://discuss.elastic.co/t/counting-the-search-term-phrase-in-a-specific-field/302107 "2022-04-11T13:49:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navanit\_dubey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navanit_dubey/32/100321_2.png) [@Navanit\_dubey](https://discuss.elastic.co/u/Navanit_dubey)\
**Post date:** [April 11, 2022, 1:49pm UTC](https://discuss.elastic.co/t/counting-the-search-term-phrase-in-a-specific-field/302107/1 "2022-04-11T13:49:12Z")

</div>

Hi, I have this type of data  
{  
"name\_id": 2145  
"address": "Antartica"  
"characteristics" : "He is a very nice person with very nice personality. the nicest thing about him is his nice dog"  
}

now I am running this query

```auto
GET friends/_search
{
  "query": {
    "bool": {
      "must": [
        {"term": {
          "name_id.keyword": "2145"
        }
        },
        {
          "match_phrase": {
            "characteristics": "nice"
          }
        }
      ]
    }
  }
}

```

is there a way I can get a count like this  
nice : 4

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [April 20, 2022, 5:19pm UTC](https://discuss.elastic.co/t/counting-the-search-term-phrase-in-a-specific-field/302107/2 "2022-04-20T17:19:49Z")

</div>

Elasticsearch is not the right tool for this kind of counts.

---

<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:** [May 18, 2022, 5:20pm UTC](https://discuss.elastic.co/t/counting-the-search-term-phrase-in-a-specific-field/302107/3 "2022-05-18T17:20:10Z")

</div>

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