# MapperParsingException：解析geo_point字段[location]失败 - 纬度[91.0]必须在[-90.0, 90.0]范围内

- **ID:** `elasticsearch/geo-point-outside-bounds`
- **领域:** elasticsearch
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 92%

## 根因

geo_point字段包含超出有效地理范围的纬度或经度值。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| elasticsearch 7.10.0 | active | — | — |
| elasticsearch 8.5.0 | active | — | — |
| elasticsearch 8.11.0 | active | — | — |

## 解决方案

1. ```
   在索引前清洗源数据：过滤掉纬度不在-90到90之间的记录，例如使用Logstash的mutate过滤器：filter { mutate { convert => ["latitude", "float"] } if [latitude] < -90 or [latitude] > 90 { drop {} } }
   ```
2. ```
   使用包含脚本处理器的管道验证并修正坐标：PUT _ingest/pipeline/geo_validate { "processors": [ { "script": { "source": "if (ctx.latitude < -90 || ctx.latitude > 90) { ctx.latitude = null }" } } ] }
   ```
3. ```
   在映射中将geo_point字段的ignore_malformed设为true，然后索引后通过查询过滤掉畸形文档。
   ```

## 无效尝试

- **** — This breaks geo queries and aggregations, and loses spatial functionality. (80% 失败率)
- **** — This hides the data quality issue and may cause data loss without alerting the user. (50% 失败率)
- **** — ignore_z_value only ignores altitude, not latitude/longitude range violations. (90% 失败率)
