[英]How to retrieve fields along with aggregate function in elasticsearch 5.1 (using curl)?
For Example in sql select count(*),x,y from abc group by x,y 例如,在sql中,从abc组中按x,y选择count(*),x,y
I want the same thing in curl 我想要卷曲的东西
You can use aggregations for that, like this: 您可以为此使用聚合,如下所示:
curl -XPOST localhost:9200/abc -d '{
"_source": ["x", "y"],
"aggs": {
"group_by_x" : {
"terms": {
"field": "x"
},
"aggs": {
"group_by_y": {
"terms": {
"field": "y"
}
}
}
}
}
}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.