Kibana 操作es更新字段

1、_update
POST /index_name/type/id/_update
{
  "doc": {
    "column": "column_value"
  }
}

示例:
POST /xxx_company/info/8fe6e9b2a9330862/_update
{
  "doc": {
    "eps": {
      "value": 0,
      "value_usd": 0
    }
  }
}
2、_update_by_query
POST index_name/_update_by_query
{
  "query": {
    "match": {
      "条件": "8fe6e9b2a9330862"
    }
  },
  "script": {
    "source": "ctx._source['column'] = params['one']",
    "params": {
      "one": "修改后的值"
    }
  }
}

示例:
POST xxxx_company/_update_by_query
{
  "query": {
    "match": {
      "_id": "8fe6e9b2a9330862"
    }
  },
  "script": {
    "source": "ctx._source['eps'] = params['one']",
    "params": {
      "one": {
        "value": 1.0,
        "value_usd": 1.1
      }
    }
  }
}
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐