Struggling with inner-hits on elasticsearch. Would appreciate any help.
I have two child types: childA and childB.
I am querying parents of childA like this
"query":{
"bool": {
"should": {
"has_child": {
"type": "ChildA",
"query": {
"match": {
"name": {
"query": "a"
}
}
}
}
}
}
}
My problem is how to include in the results all child docs of type childB as well without affecting results from the above query.
I was thinking to use inner-hits on a has_child query(type childB) for that but my query doesn't depend on childB type.
Anyone has an idea?
Thanks in advance