Hi All,
I have situation where i want to search within selected child document. like if Parent has four nested objects, and i write language.hid=1051 then only that document should be searched along with parent data.
Tried using filter but then other things are not searchable like this
{"query":{"bool":{"must":[{"match":{"firstName":{"query":"Rajesh"}}}],
"filter":[{"match":{"language.healthSystemID":{"query":"68"}}}]
}}}
I am using ES 2.X
My schema is like this
{
"id": 6,
"FirstName" : "rajesh",
"pattrib": [
{
"desc": "kutta",
"hId": 1051
},
{
"desc": "kamina",
"hId": 1068
},
{
"desc": "base kutta"
}
],
"language": [
{
"name": "English",
"hId": 1051
},
{
"name": "Hindi",
"hId": 1068
},
{
"name": "null language"
}
]
},
{
"id": 7,
"FirstName" : "rajesh",
"pattrib": [
{
"desc": "suwar",
"hId": 1051
},
{
"desc": "base suwariya"
}
],
"language": [
{
"name": "dufus",
"hId": 1051
},
{
"name": "background null"
}
]
}
}