# How can i filter out documents with missing field value

**URL:** https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519
**Category:** Elasticsearch
**Created:** [June 1, 2011, 3:00pm UTC](https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519 "2011-06-01T15:00:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)
#### Post date: [June 1, 2011, 3:00pm UTC](https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519/1 "2011-06-01T15:00:19Z")

</div>

i have lots of document to index, and some of them has no value for  
field "author", when search i want to be able to filter out those  
documents without value for field "author"

how can i achieve it?

i tryied querystring AND author:\*, but it runs very slow

---

<div class="post-metadata">

### Author: ![Stephane\_Raux](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephane_raux/32/2349_2.png) [@Stephane\_Raux](https://discuss.elastic.co/u/Stephane_Raux)
#### Post date: [June 1, 2011, 3:03pm UTC](https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519/2 "2011-06-01T15:03:26Z")

</div>

Did you try the "exists" 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.

Conversely, there is also a "missing" filter.

2011/6/1 Weiwei Wang [ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com):

> i have lots of document to index, and some of them has no value for  
> field "author", when search i want to be able to filter out those  
> documents without value for field "author"
> 
> how can i achieve it?
> 
> i tryied querystring AND author:\*, but it runs very slow

---

<div class="post-metadata">

### Author: ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)
#### Post date: [June 2, 2011, 7:35am UTC](https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519/3 "2011-06-02T07:35:09Z")

</div>

thanks, i found _exist_ is supported by query\_string

On Jun 1, 11:03 pm, Stéphane Raux [stephane.r...@gmail.com](mailto:stephane.r...@gmail.com) wrote:

> Did you try the "exists" filter ?[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/exists-filter)....
> 
> Conversely, there is also a "missing" filter.
> 
> 2011/6/1 Weiwei Wang [ww.wang...@gmail.com](mailto:ww.wang...@gmail.com):
> 
> > i have lots of document to index, and some of them has no value for  
> > field "author", when search i want to be able to filter out those  
> > documents without value for field "author"
> 
> > how can i achieve it?
> 
> > i tryied querystring AND author:\*, but it runs very slow

---

<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, 4:04am UTC](https://discuss.elastic.co/t/how-can-i-filter-out-documents-with-missing-field-value/4519/4 "2017-07-06T04:04:55Z")

</div>


