Elasticsearch 可以使用 "terms aggregation" 来统计热词。
首先,需要确定您要统计的字段。假设您要统计 "text" 字段中的热词,您可以执行以下查询:
GET my_index/_search
{
"size": 0,
"aggs": {
"hot_words": {
"terms": {
"field": "text"
}
}
}
}