How to specify the default value to a field when filtering if there is no value or filtering filed in one doc


(Red) #1

how to specify the default value to a field when filtering if there is no value or filtering filed in one doc.

can i do something like:

"filter":{
    "bool":{
        "must":{
             "term" : { "status" : "0", "missing": "0" }
       }
    }
}

just like specifying the missing value in sort


(system) #2