elasticSearch 接口实现查询热词统计

前面讲过使用elasticsearch可视化工具可以直接写语法查询如下:

GET robot-demand/_search
{
  "size":10, //查询多少条数据
  "aggs":{
    "hot_words":{
      "terms":{
        "field": "title"
      }
    }
  }
}

结果如下:

#! Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.14/security-minimal-setup.html to enable security.
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 8,
      "relation" : "eq"
    },
    "max_scor

猜你喜欢

转载自blog.csdn.net/weixin_38225763/article/details/134118608
今日推荐