# Bulk loading with different fields for update

**URL:** <https://discuss.elastic.co/t/bulk-loading-with-different-fields-for-update/251350>\
**Category:** Elasticsearch\
**Created:** [October 7, 2020, 11:12pm UTC](https://discuss.elastic.co/t/bulk-loading-with-different-fields-for-update/251350 "2020-10-07T23:12:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxunix](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@dxunix](https://discuss.elastic.co/u/dxunix)\
**Post date:** [October 7, 2020, 11:12pm UTC](https://discuss.elastic.co/t/bulk-loading-with-different-fields-for-update/251350/1 "2020-10-07T23:12:46Z")

</div>

So I have a requirement to index some data repeatedly. Each time the data might have different data fields. I want to keep the superset of the fields in the index. I.e.  
initial load the document like  
{"\_id": 100, "field1": "value1", "field2": "value2"}  
so it will be created.  
2nd time I might load as  
{"\_id": 100, "field2": "value2", "field3": "value3"}

looks like the document got updated and "field1" got removed. Is there an append way to bulk loading?

The tricky part is I would not now if each \_id exists or not. We required to use a specific column as ID. I don't want to row by row to see if the \_id exists or not as we have a lot of data.

Thank you.  
-D

---

<div class="post-metadata">

**Author:** ![dxunix](https://avatars.discourse-cdn.com/v4/letter/d/e9c0ed/32.png) [@dxunix](https://discuss.elastic.co/u/dxunix)\
**Post date:** [October 8, 2020, 12:09am UTC](https://discuss.elastic.co/t/bulk-loading-with-different-fields-for-update/251350/2 "2020-10-08T00:09:40Z")

</div>

I guess what i am looking for is bulk "index" with an option to partial update existing doc. I guess it is not possible. I can do a bulk create and bulk update for each load ... if there is a better way please let me know..Thanks!!!

-D

---

<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:** [November 5, 2020, 12:09am UTC](https://discuss.elastic.co/t/bulk-loading-with-different-fields-for-update/251350/3 "2020-11-05T00:09:42Z")

</div>

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