CopyOnWrite with Elasticsearch

Does Elasticsearch support CopyOnWrite when updating a document ?
i.e., During update, instead of performing the update in-place, is it possible to make a copy of the original document and update the copy ?

We don't have anything built in for that.

Thanks Nik.

Is there an alternate method to do that ?
Or is it possible to just copy an existing document to another document (within the same index) ?

If you are fetching the document in your application you can send the document back with a new ID. Beyond that I don't know of a way.

Cool. Thanks !!
That is what I do already.

Is there a chance this functionality will be added in a future version of Elasticsearch ?

I think it depends on what you are using it for and whether you need it done in elasticsearch or you can do it in your application. You could write a plug-in to elasticsearch. I believe you'd implement ActionPlugin. I don't think it is a thing we'd put in Elasticsearch, but I could be wrong. Like I said, if I knew more specifically why it'd be better in Elasticsearch instead of in your application it'd help.

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