# Query for absence of field

**URL:** https://discuss.elastic.co/t/query-for-absence-of-field/7457
**Category:** Elasticsearch
**Created:** [April 24, 2012, 9:15pm UTC](https://discuss.elastic.co/t/query-for-absence-of-field/7457 "2012-04-24T21:15:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aaron](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aaron](https://discuss.elastic.co/u/aaron)
#### Post date: [April 24, 2012, 9:15pm UTC](https://discuss.elastic.co/t/query-for-absence-of-field/7457/1 "2012-04-24T21:15:47Z")

</div>

I would like to index some document with a field, isActive = true, and then  
later query for documents that have this field = false or that do not have  
the field at all. Can I query for documents that are absent values for a  
given field?

---

<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: [April 24, 2012, 9:36pm UTC](https://discuss.elastic.co/t/query-for-absence-of-field/7457/2 "2012-04-24T21:36:57Z")

</div>

Are you looking for the missing filter ?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

HTH  
David 😉  
Twitter : @dadoonet / @elasticsearchfr

Le 24 avr. 2012 à 23:15, aaron [atdixon@gmail.com](mailto:atdixon@gmail.com) a écrit :

> I would like to index some document with a field, isActive = true, and then later query for documents that have this field = false or that do not have the field at all. Can I query for documents that are absent values for a given field?

---

<div class="post-metadata">

### Author: ![aaron](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aaron](https://discuss.elastic.co/u/aaron)
#### Post date: [April 24, 2012, 10:39pm UTC](https://discuss.elastic.co/t/query-for-absence-of-field/7457/3 "2012-04-24T22:39:34Z")

</div>

Thank you!

On Tuesday, April 24, 2012 4:36:57 PM UTC-5, David Pilato wrote:

> Are you looking for the missing filter ?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/missing-filter.html)
> 
> HTH  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr
> 
> Le 24 avr. 2012 à 23:15, aaron \<\> a écrit :
> 
> > I would like to index some document with a field, isActive = true, and  
> > then later query for documents that have this field = false or that do not  
> > have the field at all. Can I query for documents that are absent values for  
> > a given field?

---

<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 6, 2017, 3:31am UTC](https://discuss.elastic.co/t/query-for-absence-of-field/7457/4 "2017-07-06T03:31:13Z")

</div>


