Our service is written in Java and uses Elasticsearch Java client version 7.10.1.
We are using an ingest pipeline called "date index name processor" in order to determine our indexes names. We have 2 types of events: index and update.
index event: this event should index a new document to Elasticsearch. Each index message contains a field that represents the message start time. The pipeline uses this field's value, concating a fixed prefix and determine the index name that this message should be indexed to. If this index already exists it will index the message to it, if it doesn't it will create a new index with this name (each index should contain thousands of messages). The ID is also a part of the message.
Update event: this event is an update to an existing document. Each update message contains both message start time and ID fields (same as the index event).
The problem is that when I receive an update event, I have no idea what is the index name of the document I wish to update. Therefore, I would like to use the same ingest pipeline with the same logic, the only difference is that instead of index a message I wish to update an existing document. Moreover, as I mentioned, the update event contains the ID of the message, which can help me to find it in its index.
It sounds trivial, but for some reason, I can't find a way to use a pipeline in an update request.
Does anyone know how this can be solved?