Skip to content

Version is ignored in Document Update API #42497

Closed
@ioanatia

Description

@ioanatia

Elasticsearch version (bin/elasticsearch --version):

Version: 7.1.0, Build: default/tar/606a173/2019-05-16T00:43:15.323135Z, JVM: 12.0.1

Description of the problem including expected versus actual behavior:

The docs specify that version is still a supported parameter.
However version seems to be ignored.
Other document APIs (e.g. delete) no longer support version.

Steps to reproduce:

PUT test
{
  "mappings": {
    "properties": {
      "name": { "type": "text" }
    }
  }
}

PUT test/_doc/1
{
  "name": "test1"
}

GET test/_doc/1

# does not support version, fails with validation error
DELETE test/_doc/1?version=10000

# this works in ES 7, but it shouldn't?
POST test/_update/1?version=10000
{ 
  "doc": {
    "name": "test2"
  }
}

response:
{
  "_index" : "test",
  "_type" : "_doc",
  "_id" : "1",
  "_version" : 2,
  "result" : "updated",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 1,
  "_primary_term" : 1
}

As a side note, for noop updates it would be great if the response would contain _seq_no and _primary_term:

{
  "_index" : "test",
  "_type" : "_doc",
  "_id" : "1",
  "_version" : 2,
  "result" : "noop",
  "_shards" : {
    "total" : 0,
    "successful" : 0,
    "failed" : 0
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions