Counting the SEARCH term/phrase in a specific field

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

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

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

1 Like

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