# Is it possible to exclude empty values at the index settings?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302
**Category:** Elasticsearch
**Created:** [June 3, 2018, 4:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302 "2018-06-03T04:41:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)
#### Post date: [June 3, 2018, 4:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302/1 "2018-06-03T04:41:46Z")

</div>

Sometimes, I receive data to be indexed where some fields can be empty.

I would like to exclude those properties at index time rather than process them myself before sending the request to index it. Is it possible to configure the index to exclude those properties or do I need to do it manually?

For example. Consider the following document :

```
{
  "name": "Sophie",
  "lastname": "Dean",
  "email": ""
}

```

I would like to index only :

```
{
  "name": "Sophie",
  "lastname": "Dean",
}
```

---

<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: [June 3, 2018, 7:45am UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302/2 "2018-06-03T07:45:06Z")

</div>

This is something to do before indexing effectively the document.

Better to do it on your side but you can have a look at ingest feature and you can may be write a painless script to alter the source.

---

<div class="post-metadata">

### Author: ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)
#### Post date: [June 3, 2018, 3:40pm UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302/3 "2018-06-03T15:40:22Z")

</div>

Could you please clarify if there is any performance burden at search time if I store documents with empty values?

---

<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: [June 3, 2018, 5:06pm UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302/4 "2018-06-03T17:06:25Z")

</div>

As the source is a bit bigger, fetching the \_source will take may be more time.

---

<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 1, 2018, 5:06pm UTC](https://discuss.elastic.co/t/is-it-possible-to-exclude-empty-values-at-the-index-settings/134302/5 "2018-07-01T17:06:26Z")

</div>

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