# Handling Null Values

**URL:** https://discuss.elastic.co/t/handling-null-values/107867
**Category:** Elasticsearch
**Created:** [November 16, 2017, 6:13am UTC](https://discuss.elastic.co/t/handling-null-values/107867 "2017-11-16T06:13:02Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [November 16, 2017, 6:27am UTC](https://discuss.elastic.co/t/handling-null-values/107867/2 "2017-11-16T06:27:08Z")

</div>

Take a look at building [a `bool` query with two `should` clauses](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html). You can use a `bool` query as one of the `should` clauses in order to invert an `exists` query using a `must_not` clause

```json
{
  "query": {
    "bool" : {
      "should" : [
        { "bool" : { 
            "must_not" : [
              { "exists": { "field" : "brand_name" } } 
            ] 
          } 
        },
        { "term" : { "brand_name" : "some brand name" } }
      ]
    }
  }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/handling-null-values/107867)._
