# Query to remove null fields from the index

**URL:** <https://discuss.elastic.co/t/query-to-remove-null-fields-from-the-index/72355>\
**Category:** Elasticsearch\
**Created:** [January 21, 2017, 1:28am UTC](https://discuss.elastic.co/t/query-to-remove-null-fields-from-the-index/72355 "2017-01-21T01:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shambar](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@shambar](https://discuss.elastic.co/u/shambar)\
**Post date:** [January 21, 2017, 1:28am UTC](https://discuss.elastic.co/t/query-to-remove-null-fields-from-the-index/72355/1 "2017-01-21T01:28:45Z")

</div>

In my index I have data that resembles  
Doc 1  
"field\_1" : "here I am"  
"Display\_name" : null

Doc 2  
"field\_1":"I am also here"  
"Display\_name" : "test"

I am trying to remove the display\_name field and value from Doc1.  
I would like a query to remove the fields that are Null from the index. I do not want to have to reindex all the data. I am currently using elastic 2.2

any help would be much appreciated.

---

<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:** [February 18, 2017, 1:29am UTC](https://discuss.elastic.co/t/query-to-remove-null-fields-from-the-index/72355/2 "2017-02-18T01:29:06Z")

</div>

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