欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

ES 群集架构说明

最编程 2024-03-06 20:38:07
...
// 创建pipeline: 名字为replace_content,如果数据的name字段值是swk,就把name字段的值改为孙悟空 http://xxx.xxx.xxx.xxx:9200/_ingest/pipeline/replace_content { "processors":[ { "set":{ "if":"ctx.name == 'swk'", "field":"name", "value":"孙悟空" } } ] } // 使用pipeline:就是在插入数据时指定你的pipeline名字 http://xxx.xxx.xxx.xxx:9200/person/person?pipeline=replace_content { "name":"swk", "country": "中国", "age":500 } // 结果: { "took": 2, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 1, "relation": "eq" }, "max_score": 5.896224, "hits": [ { "_index": "person", "_type": "person", "_id": "K5qUSXgBLLjdyTtcB4ZQ", "_score": 5.896224, "_source": { "country": "中国", "name": "孙悟空", "age": 500 } } ] } }