両方の集計の PARTY_ID の数は同じである必要があります。ある場合は 3000 で、別の場合は等しくないすべての値 (2675 + 244 + 41 + 6 + 2 = 2950 ) の合計です。何が原因でしょうか?
GET /test/data/_search
{
"size": 0,
"aggs": {
"ASSET_CLASS": {
"terms": {
"field": "ASSET_CLASS_WORST"
},
"aggs": {
"ASSET_CLASS": {
"cardinality": {
"field": "PARTY_ID"
}
}
}
},
"Total count": {
"cardinality": {
"field": "PARTY_ID"
}
}
}
}
結果 :
{
"took": 9,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 51891,
"max_score": 0,
"hits": []
},
"aggregations": {
"Total count": {
"value": 3000
},
"ASSET_CLASS": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "NPA",
"doc_count": 49252,
"ASSET_CLASS": {
"value": 2675
}
},
{
"key": "RESTRUCTURED",
"doc_count": 2275,
"ASSET_CLASS": {
"value": 244
}
},
{
"key": "SMA2",
"doc_count": 308,
"ASSET_CLASS": {
"value": 41
}
},
{
"key": "SMA1",
"doc_count": 42,
"ASSET_CLASS": {
"value": 6
}
},
{
"key": "SMA0",
"doc_count": 14,
"ASSET_CLASS": {
"value": 2
}
}
]
}
}
}