# Filter with not equal to null

**URL:** <https://discuss.elastic.co/t/filter-with-not-equal-to-null/124680>\
**Category:** Elasticsearch\
**Created:** [March 20, 2018, 5:06am UTC](https://discuss.elastic.co/t/filter-with-not-equal-to-null/124680 "2018-03-20T05:06:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneesh/32/37819_2.png) [@aneesh](https://discuss.elastic.co/u/aneesh)\
**Post date:** [March 20, 2018, 5:06am UTC](https://discuss.elastic.co/t/filter-with-not-equal-to-null/124680/1 "2018-03-20T05:06:31Z")

</div>

Hi

How can i filter data with a condition not equal to null

```
{
  "from": 0, 
  "size": 10000, 
  "query": {
    "bool": {
      "must_not": [
        { "match" : { "SubjectId" : null}}
      ]
    }
  }
}

```

giving

```
{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "No text specified for text query",
        "line": 7,
        "col": 42
      }
    ],
    "type": "parsing_exception",
    "reason": "No text specified for text query",
    "line": 7,
    "col": 42
  },
  "status": 400
}

```

Thanks  
Aneesh L

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 20, 2018, 7:55am UTC](https://discuss.elastic.co/t/filter-with-not-equal-to-null/124680/2 "2018-03-20T07:55:13Z")

</div>

May be look at the `exists` query?

---

<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:** [April 17, 2018, 7:55am UTC](https://discuss.elastic.co/t/filter-with-not-equal-to-null/124680/3 "2018-04-17T07:55:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
