I have added a new nested object field to a elastic search index. I want to update the field with some default value like [ {"key": "xyz", "value": "val1"}]. I am trying to query the index where the field value is empty or null, but was not successful.
I have tried this
"bool": {
"must_not": {
"exists": {
"field": "PropertyFields"
}
}
}
sample data
[
{
"Id": 1,
"subjectPropertyFields": [
{
"value": "xyz",
"key": "zzz"
}
]
},
{
"Id": 2
},
{
"Id": 3
}
]
I want to query ids 2,3 .