Merge documents using reindex api

Hi,

I am trying to merge documents from index A to index B where the data in index A has a generated id and in index B uses email address as a document id. The goal is to collect data for that email address in index B.

Currently I query index A using python, format the data and send it back to index using the helper.bulk() function.

Now I was playing with the reindex api and came up with this

{
"conflicts": "proceed",
"source": {
"index": "index_A"
},
"dest": {
"index": "index_B",
"version_type": "external"
},
"script": {
"inline": "ctx._id = ctx._source.email",
"lang": "painless"
}
}

According to the docs, setting the version_type to external it should update an existing document if the id exists. I find however my documents replaced with the latest one found in index A.

Is it possible to update existing documents using the reindex api?

Thanks for any help,

Paul.

No one any ideas?

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