GET /mini_program_visit_log_230731/_search
{
"size": 0,
"query": {
"bool": {
"must": [
{ "match": { "page_path.keyword": "page/pages/webviewPage/webviewPage/bunny_jump" }},
{ "match": { "brand_id": 2617 }},
{
"range": {
"create_time": {
"gte": 1690772400000,
"lte": 1690774200000
}
}
}
]
}
},
"aggs": {
"unique_values": {
"terms": {
"field": "member_id"
}
}
}
}
查询结果集:
{
"hits" : {
"total" : {
"value" : 230,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"unique_values" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 196,
"buckets" : [
{
"key" : 21572669,
"doc_count" : 7
},
{
"key" : 170332394,
"doc_count" : 4
}
]
}
}
}
es内置语法如何聚合出buckets的总数量???该怎么写这个es查询语句???
用 "cardinality"