I have a mapping structure of
parent -> child -> grandchild.
Company -> brand -> product
search filters applied at company and brand level. Sorting applied at product level. How to get company details also as inner hits.
Sample:
POST my_index/search
{
"query": {
"bool":{
"must:[
{
"has_parent": "brand",
"query":{
"has_parent":"company",
"query":{
"match_all":{}
}, "inner_hits":{}
}
}
]
}
}
"sort": "product.id"
}
How to get those details at company level as well by getting product level as a base ?