CopyOnWrite with Elasticsearch


(Bhalaji) #1

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 ?


(Nik Everett) #2

We don't have anything built in for that.


(Bhalaji) #3

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) ?


(Nik Everett) #4

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.


(Bhalaji) #5

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


(Bhalaji) #6

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


(Nik Everett) #7

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.