Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch-1.3.6
Describe the issue:
Hi everyone,
In our project, we use custom _id values based on a numeric sequence (1, 2, 3, …) instead of the automatically generated IDs.
I have a question regarding the behavior of the _reindex API:
-
If a document with a given
_idalready exists in the target index, and we run a_reindexoperation from another index that contains the same_id, can you confirm that the existing document will be overwritten? -
If we rely on automatically generated IDs instead, how does OpenSearch ensure that IDs won’t collide during a reindex into an index that already contains data?
-
More generally, what is the recommended way to guarantee that reindexing into an index with existing documents won’t accidentally overwrite a document that happens to share the same
_idas one coming from the source index?
Thanks in advance for your help!