I've documents like these - Doc1:
{
"attr1": "attrVal1",
"nestedAttr": [
{
"id": 1,
"type": "Type1",
"output": "PASS"
},
{
"id": 2,
"type": "Type2",
"output": "FAIL"
},
{
"id": 3,
"type": "Type1",
"output": "PASS"
}
]
}
Doc2:
{
"attr1": "attrVal1",
"nestedAttr": [
{
"id": 1,
"type": "Type2",
"output": "PASS"
},
{
"id": 2,
"type": "Type1",
"output": "FAIL"
},
{
"id": 3,
"type": "Type1",
"output": "PASS"
}
]
}
nestedAttr is of nested mapping. I want to search of all attr1s which have "type": "Type1" and "output": "PASS". I don't care about the output of Type2 but if any of the Type1 has FAIL in a document, it should be ignored. So in above example, Doc1 will be returned for the query and Doc2 will not be returned.
I tried queries with permutation and combination of must and must_not but all are just searching for at least one match among the nested objects.