elasticsearch 在Elasticsearch中使用Groovy脚本更新多字段,elasticsearch,groovy,elasticsearch,Groovy" /> elasticsearch 在Elasticsearch中使用Groovy脚本更新多字段,elasticsearch,groovy,elasticsearch,Groovy" />

elasticsearch 在Elasticsearch中使用Groovy脚本更新多字段

elasticsearch 在Elasticsearch中使用Groovy脚本更新多字段,elasticsearch,groovy,elasticsearch,Groovy,我有以下多字段映射:- { "mappings": { "my_type": { "properties": { "city": { "type": "text", "fields": { "raw": { "type": "keywo

我有以下多字段映射:-

{
    "mappings": {
        "my_type": {
            "properties": {
                "city": {
                    "type": "text",
                    "fields": {
                        "raw": {
                            "type": "keyword"   
                        }    
                    }
                }    
            }   
        }    
    }
}
我正在使用脚本处理器的摄取管道。我只想使用groovy脚本设置city.raw的值。我尝试了各种groovy选项,但无法访问它。下面是我尝试过的一个选项

PUT _ingest/pipeline/pipe2
{
    "processors" : [
    {    
        "script": {
            "lang": "groovy",
            "inline": "ctx.city.raw='new City'"
      }
    }
  ]
}

有人能帮我一下吗

你的期望是什么?我知道你想改变城市,但为什么?你想修复什么?我有下面的用例,我想满足-