How to update a document in ElasticSearch while using external versioning

Viewed 308

I want to perform an upsert in Elasticsearch 7.9 using external versioning (time-based versioning). I try to perform the update API but when specifying the version and version_type=external.

indexName/_update/id?version=1234568&version_type=external
{
  "doc": {...},
  "doc_as_upsert": true
}

I keep getting the error:

Validation Failed: 1: internal versioning can not be used for optimistic concurrency control. Please use if_seq_no and if_primary_term instead

But I'm not using internal versioning here - why does it give this error? Does the update API not support providing version this way?

1 Answers

Apparently, it is not possible to use external versioning when 'updating' a document in ElasticSearch. The documentation does not specify this explicitly, but provides no options to provide an external version.

Related