ruflin/Elastica

Internal versioning error when adding a document from one index to another

pidera opened this issue · 0 comments

When adding a document from one index to another index, the version and version_type options are still added, which causes a validation error.

Elastica\Exception\ResponseException: Validation Failed: 1: internal versioning can not be used for optimistic concurrency control. Please use `if_seq_no` and `if_primary_term` instead;

In #1803 these options have been removed for the updateDocument method, but these are still added in addDocument.

I've created a separate repository to simulate the testcase:

Failing version: https://github.com/pidera/elastica-version-issue/tree/failing
Passing version: https://github.com/pidera/elastica-version-issue/tree/passing

I'll open a pull request with the fix I've come up with, let me know if this is adequate or not!