curl -X GET "localhost:9200/order/_search?pretty" -H 'Content-Type: application/json' -d'{
"query": {
"bool": {
"filter": [{ "term": { "state.keyword": "1" } }] //成功购买的,state == 1
}
},
"size": 0,
"aggs": {
"my_groups": {
"terms": {
"field": "userid.keyword", //根据userid分组
"size":100, //前100
"min_doc_count": 2, //至少购买了2次
"order" : { "_count" : "desc" } //按数量倒序
}
}
}
}'
es 查询多次成功购买的前100个用户
最新推荐文章于 2024-01-01 19:37:51 发布