# 无效别名异常：别名[logs_current]指向缺失的索引[logs-2025.03]

- **ID:** `elasticsearch/alias-points-to-missing-index`
- **领域:** elasticsearch
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 93%

## 根因

别名被配置为引用一个已被删除或不存在的索引，导致对别名的操作失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.17.12 | active | — | — |
| 8.11.0 | active | — | — |
| 8.13.0 | active | — | — |

## 解决方案

1. ```
   更新别名指向现有索引：POST _aliases { "actions": [ { "remove": { "index": "logs-2025.03", "alias": "logs_current" } }, { "add": { "index": "logs-2025.04", "alias": "logs_current" } } ] }
   ```
2. ```
   如果索引被意外删除，从快照恢复：POST _snapshot/my_repo/snapshot_2025/_restore { "indices": "logs-2025.03", "rename_pattern": "logs-2025.03", "rename_replacement": "logs-2025.03" }
   ```

## 无效尝试

- **** — If the mapping does not match the expected schema, the alias may work but queries fail; also, data from the original index is lost (70% 失败率)
- **** — The alias still references the missing index; it must be updated to point to an existing index (95% 失败率)
