I have an elasticsearch index with following mapping, some documents contain objects of status {id:1, status:"failed"} and some are null, cant seem to find a way where i can search for documents having "status.name" as ["failed", "null", "passed"] (docs where either status is failed, passed or not set/null). e.g doing a term query like below gives empty resultset
{
"name":{
"type":"keyword"
}
"status": {
"properties": {
"id": {
"type": "integer"
},
"status": {
"type": "keyword"
}
}
}
}
query tried:
{
"terms": {
"status.name": [ "failed", "null" ]
}
Also tried setting the mapping of status.name as "null_value": "null"