0

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": "B08F2BWX2V"
        }
        },
        {
          "match_phrase": {
            "characteristics": "nice"
          }
        }
      ]
    }
  }
}

is there a way i can get the results and the word count i.e, nice : 4

Paulo
  • 8,690
  • 5
  • 20
  • 34

1 Answers1

0

There is an elastic api that can return the token count information you need. It is the Term vectors API. I'm not sure if it will be exactly what you need but I saw in the post below a question similar to yours: https://stackoverflow.com/a/69734423/18778181

rabbitbr
  • 2,991
  • 2
  • 4
  • 17