Getting total term frequency throughout entire index (Elasticsearch)

前端 未结 3 599
星月不相逢
星月不相逢 2021-02-05 13:25

I am trying to calculate the total number of times a particular term occurs throughout an entire index (term collection frequency). I have attempted to do so through the use of

3条回答
  •  面向向阳花
    2021-02-05 14:06

    Have you tried simply using COUNT API? https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-count.html

    It can return the number of matches for a query. So something like this may work.

    GET /my_index/_count
    {
        "query" : {"match": {"my_field": "my_keyword"}
    }
    

提交回复
热议问题