# Update partial fields leads to other fields missing that are excluded in the \_source

**URL:** https://discuss.elastic.co/t/update-partial-fields-leads-to-other-fields-missing-that-are-excluded-in-the-source/257790
**Category:** Elasticsearch
**Created:** [December 7, 2020, 1:38am UTC](https://discuss.elastic.co/t/update-partial-fields-leads-to-other-fields-missing-that-are-excluded-in-the-source/257790 "2020-12-07T01:38:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chemboking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chemboking/32/79162_2.png) [@chemboking](https://discuss.elastic.co/u/chemboking)
#### Post date: [December 7, 2020, 1:38am UTC](https://discuss.elastic.co/t/update-partial-fields-leads-to-other-fields-missing-that-are-excluded-in-the-source/257790/1 "2020-12-07T01:38:36Z")

</div>

For example, i have a mapping as followed:

```auto
     {
       "mappings": {
          "_source": {
               "includes": [
                 "gender"
               ]
          },
          "properties": {
             "name": {
                "type": "keyword"
             },
             "gender": {
                "type": "keyword"
             }
          }
     }
 }

```

After i put a document into the index, if i update this document with

```auto
POST myindex/_doc/1/_update
    {
        "doc":{
            "gender":"male"
        }
    }

```

i will lose the name field forever. Because the name field is not included in the \_source.  
I understand that every update operation is a brand new reindex, es will take the whole \_source out of the document and execute the index operation again even just update one or two fields out of 100. Under this circumstance, i have to gather all the fields that are excluded in the \_source to make an update-one-field operation.  
The reason why i exclude these fields is that i want to make the index as small as possible. We fetch the fields through docvalue\_fields and disable the whole \_source, in this case, our index is fast and small.  
So what's your suggestion if we want to do the update partial fields and leave the whole source disabled?

---

<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: [December 7, 2020, 3:10am UTC](https://discuss.elastic.co/t/update-partial-fields-leads-to-other-fields-missing-that-are-excluded-in-the-source/257790/2 "2020-12-07T03:10:55Z")

</div>

> [@chemboking](#):
>
> So what's your suggestion if we want to do the update partial fields and leave the whole source disabled?

I don't think it's possible. And IMHO you should always keep the `_source` intact.

---

<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: [January 4, 2021, 3:11am UTC](https://discuss.elastic.co/t/update-partial-fields-leads-to-other-fields-missing-that-are-excluded-in-the-source/257790/3 "2021-01-04T03:11:26Z")

</div>

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