1. 查看索引

curl -k https://192.168.1.123:9200/_cat/indices?v --user admin:password

2. 删除索引

curl -k -XDELETE https://192.168.1.123:9200/index_name?pretty --user admin:password

3. 根据条件查询数据

curl -k -XPOST https://192.168.1.123:9200/index_name/_delete_by_query?pretty -d '{"query": {"bool" : { "must": {"match": {"name" : {"query" : "你的名字"}}}}}}' -H "Content-Type: application/json" --user admin:password;

4. 根据条件删除数据
curl -k -XPOST https://192.168.1.100:123/index_name/_delete_by_query?pretty -d '{"query": {"bool" : { "must": {"match": {"name" : {"query" : "你的名字"}}}}}}' -H "Content-Type: application/json" --user admin:password;

5. 更新

curl -XPOST -H "Content-Type:application/json" 'http://192.168.31.215:9201/customer/_update/1?pretty' -d '

{

"doc": {

"name":"你的名字",

"JobS": "Linux",

"Age": 25,

"gender": "man"

}

}'

Logo

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

更多推荐