Efficient copying of document to new instance and changing a couple fields


(bryan rasmussen) #1

I have a document in an index I need to make another document in the index that has almost all the same fields but with of course a new _id, and a couple fields different.

Obviously I can get the document, change the fields, and then insert the new document but I was hoping there was some efficient way of handling this use case - I am using node.js elasticsearch client currently.


(Nik Everett) #2

I'm working on a simpler way to do this over here. Under the covers it fetches the document and modifies it and reindexes it just like you want to do. So if I were you that is what I'd do. For the most part it is the only way to do it.


(system) #3