XPCegeka / ElasticUp

Easy ElasticSearch migrations for continuous delivery!
MIT License
8 stars 3 forks source link

BatchUpdateOperation - use of id #21

Open tomboon opened 6 years ago

tomboon commented 6 years ago

We recently fixed an issue in BatchUpdateOperation.

BatchUpdateOperation will scroll-search from a sourceIndex, and bulkIndex to a targetIndex. It will check if your document has an Id property, and if so, use this Id property as the id to index in ElasticSearch (using Id.ToString()). If there is no Id property on your document, it will use the _id that was assigned by ElasticSearch when you first indexed the document.

However, there might be a third usecase: What if your document has an Id object, but you chose to explicitely set a different Id when indexing. In this case the BatchUpdateOperation will use the Id.ToString from your object. Which may not be what you want... (looks like a weird way of working tough).

Should we support this usecase? To be decided...