elasticsearch data_error ai_generated true

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

MapperParsingException: failed to parse geo_point field [location] - latitude [91.0] must be in range [-90.0, 90.0]

ID: elasticsearch/geo-point-outside-bounds

其他格式: JSON · Markdown 中文 · English
92%修复率
88%置信度
1证据数
2024-03-22首次发现

版本兼容性

版本状态引入弃用备注
elasticsearch 7.10.0 active
elasticsearch 8.5.0 active
elasticsearch 8.11.0 active

根因分析

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

English

A geo_point field contains a latitude or longitude value outside the valid geographic range.

generic

官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html

解决方案

  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,然后索引后通过查询过滤掉畸形文档。

无效尝试

常见但无效的做法:

  1. 80% 失败

    This breaks geo queries and aggregations, and loses spatial functionality.

  2. 50% 失败

    This hides the data quality issue and may cause data loss without alerting the user.

  3. 90% 失败

    ignore_z_value only ignores altitude, not latitude/longitude range violations.