索引-删除
在 Postman 中,向 ES 服务器发 DELETE 请求 : http://localhost:9200/shopping
DELETE http://localhost:9200/shopping
1
返回结果
{
"acknowledged": true
}
1
2
3
2
3
示例图
注意:再次执行删除操作时会返回错误,索引不存在
{
"error": {
"root_cause": [
{
"type": "index_not_found_exception",
"reason": "no such index [shopping]",
"resource.type": "index_or_alias",
"resource.id": "shopping",
"index_uuid": "_na_",
"index": "shopping"
}
],
"type": "index_not_found_exception",
"reason": "no such index [shopping]",
"resource.type": "index_or_alias",
"resource.id": "shopping",
"index_uuid": "_na_",
"index": "shopping"
},
"status": 404
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Last Updated: 2022/02/05, 15:58:51