Skip to content

Updates in bulk api always update shards. #19267

@gkozyryatskyy

Description

@gkozyryatskyy

Elasticsearch version: 2.3.3

JVM version: 1.8.0_45

OS version: OS X 10.11.5

Description of the problem including expected versus actual behavior:
Bulk api with updates respond _shards.successful > 0 even if new _source not different from the old _source.

Steps to reproduce:

nano request
{ "update" : { "_index" : "test", "_type" : "test", "_id" : "1" } }
{ "doc" : {"data" : "some_data"}, "doc_as_upsert" : true }

# returning _shards.successful = 1
curl -XPOST 'localhost:9200/_bulk' --data-binary "@requests";

# sending request again. This should return _shards.successful = 0 but instead returns _shards.successful = 1
curl -XPOST 'localhost:9200/_bulk' --data-binary "@requests";

Here is example with _update api

# returns _shards.successful = 1
curl -XPOST localhost:9200/test/test/1/_update?pretty -d '{ "doc" : {"data" : "some_data"}, "doc_as_upsert" : true }'

# sending request again. Returns _shards.successful = 0
curl -XPOST localhost:9200/test/test/1/_update?pretty -d '{ "doc" : {"data" : "some_data"}, "doc_as_upsert" : true }'

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>buggood first issuelow hanging fruithelp wantedadoptme

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions