# How to query the docs of an index having the time filter is null

**URL:** <https://discuss.elastic.co/t/how-to-query-the-docs-of-an-index-having-the-time-filter-is-null/206814>\
**Category:** Elasticsearch\
**Created:** [November 6, 2019, 3:00pm UTC](https://discuss.elastic.co/t/how-to-query-the-docs-of-an-index-having-the-time-filter-is-null/206814 "2019-11-06T15:00:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geethusureshkrishna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geethusureshkrishna/32/54899_2.png) [@geethusureshkrishna](https://discuss.elastic.co/u/geethusureshkrishna)\
**Post date:** [November 6, 2019, 3:00pm UTC](https://discuss.elastic.co/t/how-to-query-the-docs-of-an-index-having-the-time-filter-is-null/206814/1 "2019-11-06T15:00:25Z")

</div>

Some of the docs in an index having the time filter is null/none/no value. How to create a GET query to filter out those documents?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 7, 2019, 9:09am UTC](https://discuss.elastic.co/t/how-to-query-the-docs-of-an-index-having-the-time-filter-is-null/206814/2 "2019-11-07T09:09:13Z")

</div>

you can use the `exists` query, see [https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl-exists-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl-exists-query.html)

Use a `bool` query with a `must_not` clause, that contains the exists query, basically searching for a document where this field does not exist.

--Alex

---

<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:** [December 5, 2019, 9:09am UTC](https://discuss.elastic.co/t/how-to-query-the-docs-of-an-index-having-the-time-filter-is-null/206814/3 "2019-12-05T09:09:23Z")

</div>

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