Replicating documents from one index to another in real time

I have an existing index with several documents that receives them from a service. I want to create a new index (data stream to be more specific) with a differente template. I want the second index to have the same documents as the first one. I know i can reindex the documents from the first index to the second one, but once this is done, I want the second index to be updated every time the first index receives a new index, i.e. I want that every time a document enters the first index, it is copied to the second index automatically so I don't have to run the reindex again, since this first index is going to receive documents constantly. Is there any way to achieve this?

Sorry for my english and thanks anyway.

No, you would need to constantly run reindex from one index to another.

The easiest solution in this case is to index the data in both index at the same time, but if this is possible or not in your case will depends on how you are indexing your data.

1 Like