我在 KIbana 中运行了一个查询,先按 `room_id` 分组,然后根据 `member_id` 计算用户数:
但是我发现反过来的操作却是可以的,用 `member_id` 分组,然后再用 `room_id` 来计算(虽然这么做没什么意意义,我只是随便试试):
请问,这是什么原因呢?
GET wxdata/_search?
{
"size":0,
"query": {
"bool": {
"must": {
"term": {
"action": "wxlive_live_view"
}
}
}
},
"aggs": {
"rooms": {
"terms":{
"field": "payload.room_id.keyword"
}
},
"aggs": {
"uv": {
"cardinality": {
"field": "member_id.keyword"
}
}
}
}
}
结果提示:{
"error": {
"root_cause": [
{
"type": "named_object_not_found_exception",
"reason": "[19:13] unable to parse BaseAggregationBuilder with name [uv]: parser not found"
}
],
"type": "named_object_not_found_exception",
"reason": "[19:13] unable to parse BaseAggregationBuilder with name [uv]: parser not found"
},
"status": 400
}
但是我发现反过来的操作却是可以的,用 `member_id` 分组,然后再用 `room_id` 来计算(虽然这么做没什么意意义,我只是随便试试):
GET wxdata/_search?
{
"size":0,
"query": {
"bool": {
"must": {
"term": {
"action": "wxlive_live_view"
}
}
}
},
"aggs": {
"rooms": {
"terms":{
"field": "member_id.keyword"
},
"aggs": {
"room": {
"cardinality": {
"field": "payload.room_id.keyword"
}
}
}
}
}
}
请问,这是什么原因呢?
2 个回复
elasticStack - 90后it大数据男
赞同来自: adow
adow
赞同来自: