I have a nested type-> documents inside applications. I want to retrieve the applications which do not contain the documents with document_type 6.
{
"query": {
"bool": {
"must_not": [
{
"nested": {
"path": "documents",
"query": {
"bool": {
"must": [
{
"term": {
"document_type": 6
}
}
]
}
}
}
}
]
}
}
}
This gives applications with document_type 6 as well. Not sure if there's something wrong with the query.