前面讲过使用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