I have a mapping as follow,
PUT parent_child_grandchild
{
"mappings": {
"gran": {},
"father": {
"_parent": {
"type": "gran"
}
},
"son": {
"_parent": {
"type": "father"
}
}
}
}
how can i get a nested json result as
{
"gran": {
"gran_field": "ggg",
"father": [
{
"father_field": "eee",
"son": [
{
"son_field": "dfdfd"
},
{
"son_field": "dfdfd"
}
]
},
{
"father_field": "eee",
"son": {
"son_field": "dfdfd"
}
}
]
}
}
Looks like inner_hits can make it.
Thanks.