Say I have a parent document
curl -XPUT es-host:9200/index/parent_type/1 -d '{
"foo": "bar"
}'
and I have a child document
curl -XPUT es-host:9200/index/child_type/?parent=1 -d '{
"child-foo-1": "child-bar-1",
"child-foo-2": "child-bar-2"
}'
Is there any way to get sub-aggregations for my child document data under parent document aggregations, something like,
{
"aggregations": {
"foo-aggregations": {
"buckets": [
{
"key": "bar",
"doc_count": 1,
"child-foo-1-aggregations": {
"key": "child-bar-1",
"doc_count": 1
},
"child-foo-2-aggregations": {
"key": "child-bar-2",
"doc_count": 1
}
}
]
}
}
}