使用 Elasticsearch,我可以通过索引名称删除索引:
DELETE my_index
{}
但我无法通过别名删除它:
DELETE my_index_alias
{}
错误是:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The provided expression [my_index_alias] matches an alias, specify the corresponding concrete indices instead."
}
],
"type": "illegal_argument_exception",
"reason": "The provided expression [my_index_alias] matches an alias, specify the corresponding concrete indices instead."
},
"status": 400
}
有没有办法通过别名删除索引?
最佳答案
我相信你想要实现的目标是不可能的。目前,ElasticSearch DELETE API 支持以下内容:
- 您可以删除索引
curl -XDELETE 'http://localhost:9200/{indexname}'
当且仅当 {indexname} 是具体索引时才删除 {indexname}。
或 2. 删除别名
curl -XDELETE 'http://localhost:9200/_alias/{aliasname}'
当且仅当 {aliasname} 是索引别名时才删除 {aliasname}。
关于elasticsearch - 按别名删除索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52875482/