记录下es 查询差别
前端时间做es聚合处理的时候需要对数量进行聚合统计,使用
GET /index-*/_search?search_type=count
报错了
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "No search type for [count]"
}
],
"type" : "illegal_argument_exception",
"reason" : "No search type for [count]"
},
"status" : 400
}
search_type=count 已经不支持新版本(7.x)的查找了
现在使用的是 “size”: 0 替换
GET /index-*/_search
{
"size": 0,
"query": {
"terms": {
"ip":["192.168.0.1", "192.168.0.2"]
}
},
"aggs": {
"user": {
"terms": {
"field": "user"
}
}
}
}
421



被折叠的 条评论
为什么被折叠?



