How to fix one field in elasticsearch by using document_id?

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.


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?


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?

If you are updating different fields, how about using the update API and upserts? See Update API | Elasticsearch Guide [7.14] | Elastic