首页 » Linux » elasticsearch 增加mapping字段,并更改默认值

elasticsearch 增加mapping字段,并更改默认值

 

 curl -X POST -H  'Content-Type:application/json'   http://127.0.0.1:9200/index_name/_mapping -d '{"properties":{"check":{"type":"integer"}}}'

 curl -X POST -H  'Content-Type:application/json'   http://127.0.0.1:9200/index_name/_update_by_query -d '{ "script": {"lang": "painless","source": "if (ctx._source.check == 1) {ctx._source.check = 0}"}}'

查询数据:
http://127.0.0.1:9200/index_name/_search?pretty

查询index信息
curl http://127.0.0.1:9200/index_name?pretty

以下是针对es 7.x

原文链接:elasticsearch 增加mapping字段,并更改默认值,转载请注明来源!

0