当前位置:   article > 正文

Elasticsearch查询修改某条数据_elasticsearch修改数据

elasticsearch修改数据

获取index和type

  1. 1.查看index
  2. curl -X GET 'ip地址:9200/_cat/indices?v'
  3. 2.查看type
  4. curl -X GET 'http://ip地址:9200/_mapping?pretty=true'

1.查询数据

  1. curl -X GET "ip地址:9200/index名/type名/id?pretty"
  2. eg:curl -X GET "192.168.61.150:9200/punishment/enterprise/1?pretty"

2.新增数据

curl -X PUT "ip地址:9200/index名/type名/id?pretty" -H 'Content-Type: application/json' -d'{"name": "名称"}'

3.修改数据

  1. curl -X POST "ip地址:9200/index名/type名/id/_update?pretty" -H 'Content-Type: application/json' -d'
  2. {
  3. "doc": { "name": "名称" }
  4. }'
  1. eg:curl -X POST "192.168.61.150:9200/punishment/enterprise/1/_update?pretty" -H 'Content-Type: application/json' -d'
  2. {
  3. "doc": { "name": "123456789" }
  4. }'

4.删除数据

curl -X DELETE "ip地址:9200/index名/type名/id?pretty"

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/67944
推荐阅读
相关标签
  

闽ICP备14008679号