elasticsearch-java icon indicating copy to clipboard operation
elasticsearch-java copied to clipboard

Missing "copyFrom()" method into SetProcessor

Open OlivierRo opened this issue 3 years ago • 0 comments

Java API client version

7.17.5 (probably 8.3.2 too)

Java version

17

Elasticsearch Version

8.2.0

Problem description

With new Java API, SetProcessor hasn't a method permitting to set "copy_from" property.

For example, in my case (a pipeline composed of an enrich processor then a set processor then a remove processor) :

PUT _ingest/pipeline/zone-lookup
{
  "description": "Lookup and copy specified zone masks",
  "processors": [
    {
      "enrich": {
        "policy_name": "zones-policy",
        "field": "zoneId",
        "target_field": "zone",
        "max_matches": 1,
        "if": "ctx.containsKey('zoneId')"
      }
    },
    {
      "set": {
        "field": "masks",
        "copy_from": "zone.masks",
        "if": "ctx.containsKey('zone')"
      }
    },
    {
      "remove": {
        "field": "zone",
        "if": "ctx.containsKey('zone')"
      }
    }
  ]
}

SetProcessor object only permits to set properties field, override and value (if_ is inherited from ProcessorBase with some others properties).

OlivierRo avatar Jul 15 '22 10:07 OlivierRo