Ingest pipeline in Update Api

Hi,

I'm trying to use an ingest pipeline in an update api: POST /my_index/_update/_id?pipeline=attachment

I find out this issue but it is 4 years old. Is there any update on that after 4 years?
I really don't like the idea of using a temporary index where I index my document using the ingest pipeline, get the result, and index the result in the final index.
With a huge amount of data this will become a huge amount of useless work.

To give you a better idea this is my pipeline:

{
    "description": "Extract attachment information",
    "processors": [
        {
            "foreach": {
                "field": "attachments",
                "processor": {
                  "attachment": {
                    "target_field": "_ingest._value.attachment",
                    "field": "_ingest._value.data",
                    "ignore_failure" : true
                  }
                }
            }
        },
        {
            "foreach": {
                "field": "attachments",
                "processor": {
                  "remove": {
                    "field": "_ingest._value.data"
                  }
                }
            }
        }
    ]
}

what I'm trying to do is simply:

POST /my_index/_update/_id?pipeline=attachment
{
  "script" : {
    "source": "ctx._source.attachments.add(params.data)",
    "lang": "painless",
    "params": {
      "data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
    }
  }
}

which is the same idea of what I do when I index a document

PUT /my_index/_doc/_id?pipeline=attachment
{
  "attachments": [
    {"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="},
    {"data": "dGVzdCEK"}
  ]
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.