# How to fix one field in elasticsearch by using document\_id?

**URL:** <https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538>\
**Category:** Elasticsearch\
**Created:** [September 7, 2021, 1:30pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538 "2021-09-07T13:30:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![padamrai](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@padamrai](https://discuss.elastic.co/u/padamrai)\
**Post date:** [September 7, 2021, 1:30pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538/1 "2021-09-07T13:30:59Z")

</div>

I am getting multiple messages in different queues and I am also using document\_id to avoid duplicates values. But the problem with docuemnt\_id is, it is overwriting the existing data with a new one But I want to fix one field that cannot be overwritten. In this field I am getting some information first time after that it is empty I want to store that information just to avoid missing that information.

Let suppose first time I am getting  
SMS:"Hello World How your",  
Next time I am getting SMS:""  
document\_id replaced the information with empty.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 7, 2021, 3:58pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538/2 "2021-09-07T15:58:40Z")

</div>

Hey,

I am not sure I fully understand the question or the problem. If you have an ingestion mechanism that sends empty fields, can't you stop this sending of data to Elasticsearch, before trying to process on Elasticsearch side?

--Alex

---

<div class="post-metadata">

**Author:** ![padamrai](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@padamrai](https://discuss.elastic.co/u/padamrai)\
**Post date:** [September 7, 2021, 5:49pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538/3 "2021-09-07T17:49:07Z")

</div>

I have three Queues

1. Received
2. Submitted and
3. Delivered

First queue have SMS field and I want to fixed but document\_id overwrite the previous data with new queue data. Only Received Queue have SMS information other two queues had empty field of SMS.

Any way to save SMS data so that it cannot be overwritten?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 13, 2021, 2:12pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538/4 "2021-09-13T14:12:17Z")

</div>

If you are updating different fields, how about using the update API and upserts? See [Update API | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/docs-update.html#upserts)

---

<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:** [October 11, 2021, 2:13pm UTC](https://discuss.elastic.co/t/how-to-fix-one-field-in-elasticsearch-by-using-document-id/283538/5 "2021-10-11T14:13:03Z")

</div>

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