TomonoriSoejima / Tejun

notes related to working cases
5 stars 3 forks source link

How to add empty value in some cases #84

Open TomonoriSoejima opened 2 years ago

TomonoriSoejima commented 2 years ago
POST alex/_doc/3/?pipeline=add-age
{
  "firstname": "fa",
  "lastname": "goan"
}

POST alex/_doc/2/?pipeline=fullname
{
  "firstname": "fa",
  "lastname": "goan",
  "age": "64"
}

PUT _ingest/pipeline/add-age
{
  "processors": [
    {
      "set": {
        "description": "set age if field age is missing",
        "if": "!(ctx.containsKey('age'))",
        "field": "age",
        "value": ""
      }
    }
  ]
}

GET alex/_search
image