Skip to content

ingest: Bulk upsert does not honor default ingest node pipeline #36219

@jakelandis

Description

@jakelandis

6.5. introduced the ability to define a default ingest node pipeline for a given index.

However, the default pipeline is not honored when implementing a bulk upsert request. It is however honored for non-bulk upserts.

For example:

DELETE test_index
PUT _ingest/pipeline/test_pipeline
{
    "processors" : [
      {
        "set": {
          "field": "ran_pipeline",
          "value": true
        }
      }
    ]
}

PUT test_index
{
  "settings": {
    "default_pipeline": "test_pipeline"
  }
}
POST _bulk
{"update":{"_id":"1","_index":"test_index","_type":"_doc","_routing":null,"retry_on_conflict":1}}
{"script":{"source":"ctx._source.ran_script = true"},"upsert":{"ran_upsert":true}}

GET test_index/_doc/1

Results in

{
  "_index" : "test_index",
  "_type" : "_doc",
  "_id" : "1",
  "_version" : 1,
  "found" : true,
  "_source" : {
    "ran_upsert" : true
  }
}

^^ Note the missing "ran_pipeline"

Compared to the non-bulk API call which works as expected:

POST test_index/_doc/2/_update
{
  "script":{
    "source": "ctx._source.ran_script = true" 
  },
  "upsert" :{
    "ran_upsert" : true
  }
}
GET test_index/_doc/2

Results in

{
  "_index" : "test_index",
  "_type" : "_doc",
  "_id" : "2",
  "_version" : 1,
  "found" : true,
  "_source" : {
    "ran_upsert" : true,
    "ran_pipeline" : true
  }
}

^^ Correctly ran the pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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