赞
踩
_search 命令是查询
9200/index/type/_search
_delete_by_query 命令是删除
9200/index/type/_delete_by_query
注:
删除也是先走和查询一样的语法,只是最后的命令是 删除的命令
{
"query":{
"term":{
"bookId":1
}
}
}
这是清空
{
"query": {
"match_all": {}
}
}
清空所有数据
```bash
{
"query": {
"match_all": {}
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200306005106576.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzM3MzgzODY2,size_16,color_FFFFFF,t_70) 删除后语法 ```bash { "took": 18, "timed_out": false, "total": 1, "deleted": 1, "batches": 1, "version_conflicts": 0, "noops": 0, "retries": { "bulk": 0, "search": 0 }, "throttled_millis": 0, "requests_per_second": -1.0, "throttled_until_millis": 0, "failures": [] }
deleted:1 删除成功
java 通过esId(es生产的唯一性id)
linux 删除 index type
docker exec -it 50928df885f7 /bin/bash
查看
curl -XGET ‘127.0.0.1:9200/_cat/indices?v’
或者
curl ‘localhost:9200/_cat/indices?v’
删除
curl -XDELETE ‘127.0.0.1:9200/baochuan_test’
bat 脚本删除mapping
创建一个test.bat文件,右键以管理员身份运行
curl -XDELETE http://localhost:9400/baochuan_pro
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。