The aggregation I am trying to achieve is below.
What I am trying to do here is map B and C to different columns rather than expanding rows. I could do this in Canvas but would like to use user friendly vis table instead .
Aggs
GET tags/_search
{
"size": 0,
"aggs": {
"A": {
"terms": { "field": "avi.name", "size": 2 },
"aggs": {
"B": {
"filter": { "term": { "shape.model": "effective_img" } },
"aggs": { "B-1": { "terms": { "field": "shape.model" } } }
},
"C": {
"filter": { "term": { "shape.model": "speed_limit" } },
"aggs": { "C-1": { "terms": { "field": "shape.model" } } }
}
}
}
}
}
RESULT
{
"took" : 52,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1770,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"A" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 1231,
"buckets" : [
{
"key" : "000049_0_tsr.AVI",
"doc_count" : 285,
"B" : {
"doc_count" : 0,
"B-1" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [ ]
}
},
"C" : {
"doc_count" : 39,
"C-1" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "speed_limit",
"doc_count" : 39
}
]
}
}
},
{
"key" : "000028_1_tsr.AVI",
"doc_count" : 254,
"B" : {
"doc_count" : 0,
"B-1" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [ ]
}
},
"C" : {
"doc_count" : 32,
"C-1" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "speed_limit",
"doc_count" : 32
}
]
}
}
}
]
}
}
}