elasticsearch - 按别名删除索引

标签 elasticsearch kibana

使用 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 支持以下内容:

  1. 您可以删除索引

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/

相关文章:

elasticsearch - 在ElasticSearch中,如何组合 `span_near`和 `term`?

search - ElasticSearch:查询中的匹配字段

elasticsearch - copy_to 字段没有术语向量信息

elasticsearch - 如何搜索没有特定字段的文档/记录?

elasticsearch - Kibana-给定索引,如何依靠它找到保存的对象?

node.js - 尝试使用mongosastic Elasticsearch 到Node app时出现mapper_parsing_exception

elasticsearch - Elasticsearch 字符串过滤器-是否存在这样的选项?

docker - 使用 docker 运行 kibana - 未设置 ENV 变量

elasticsearch - 数据已使用 Camel 索引到 Elasticsearch 中,但无法在Kibana或localhost:9200中看到

elasticsearch - Elastic 中的访问控制 - 缺少 REST 请求的身份验证凭据