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

**URL:** https://discuss.elastic.co/t/how-to-specify-the-default-value-to-a-field-when-filtering-if-there-is-no-value-or-filtering-filed-in-one-doc/42106
**Category:** Elasticsearch
**Created:** [February 18, 2016, 7:23am UTC](https://discuss.elastic.co/t/how-to-specify-the-default-value-to-a-field-when-filtering-if-there-is-no-value-or-filtering-filed-in-one-doc/42106 "2016-02-18T07:23:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://discuss.elastic.co/u/Red)
#### Post date: [February 18, 2016, 7:23am UTC](https://discuss.elastic.co/t/how-to-specify-the-default-value-to-a-field-when-filtering-if-there-is-no-value-or-filtering-filed-in-one-doc/42106/1 "2016-02-18T07:23:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 11:15pm UTC](https://discuss.elastic.co/t/how-to-specify-the-default-value-to-a-field-when-filtering-if-there-is-no-value-or-filtering-filed-in-one-doc/42106/2 "2017-07-05T23:15:24Z")

</div>


