# Elasticsearch映射冲突：字段'timestamp'在不同索引中类型不同

- **ID:** `data/elasticsearch-mapping-conflict`
- **领域:** data
- **类别:** schema_error
- **错误码:** `illegal_argument_exception`
- **验证级别:** ai_generated
- **修复率:** 84%

## 根因

当创建跨多个索引的索引模式或别名时，Elasticsearch检测到同一字段具有不兼容的类型（如一个索引中为'date'，另一个中为'text'），导致无法统一搜索。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Elasticsearch 7.17 | active | — | — |
| Elasticsearch 8.6 | active | — | — |
| Elasticsearch 8.11 | active | — | — |

## 解决方案

1. ```
   Reindex the conflicting indices into a new index with a unified mapping, then use an alias to point to the new index.
   ```
2. ```
   Use a runtime field in the index pattern to cast the conflicting field to a common type at query time.
   ```

## 无效尝试

- **** — Data in the deleted index is lost unless reindexed, which can be time-consuming. (90% 失败率)
- **** — Dynamic mapping can still produce conflicting types across indices. (80% 失败率)
