How to retrieve and/or store former data that has been overwritten

I need to be able to copy specific columns of data to an archival column within the same record when the record is updated. For instance, if a record had phoneNumber stored as 123-4567 and was updated to 321-8765, I would want to store the initial phone number in a second column called oldPhoneNumber which would hold onto the initial data. The only way I know to do this is to use the copy_to functionality when mapping the index, but to my knowledge that would overwrite both the original and former data column. Is there any other way of doing this in elasticsearch?

There is nothing native to ES that does this, you'd have to handle it yourself.

You may be able to achieve this by using scripted updates.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.