Hello,
I have a parent document "lead" with a child document "lead_contact".
I am trying to query a "name" field on the parent while using the has_child query at the same time to search through the fields "name", "telephone_number", "cellphone_number" and "email" on the "lead_contact" document.
This is my query so far:
POST leads/_search
{
"query": {
"bool": {
"should": {
"match": {
"name" : "test",
},
},
"should": {
"has_child": {
"type": "lead_contact",
"query": {
"multi_match": {
"query": "test",
"fields": ["name", "telephone_number", "cellphone_number", "email"],
"operator": "or"
}
}
}
}
}
}
}
The above query will not always search the "name" of the "lead" correctly. Any assistance will be much appreciated, thank you in advance.