Has anyone been able to return the granchild and grandparent record without the parent returned as well?
I have the following which returns all 3. However, I'd like to return A and C from a hierarchy like A=>B=>C.
{
"query" : {
"has_child" : {
"query" : {
"has_child" : {
"query" : {
"match_all" : {}
},
"child_type" : "grandchild"
}
},
"child_type" : "child"
}
},
"inner_hits" : {
"child" : {
"type" : {
"child" : {
"inner_hits" : {
"child" : {
"type" : {
"grandchild" : {}
}
}
}
}
}
}
}
}