mapper_parsing_exception: mapper_parsing_exception: failed to parse field [...] of type [...](无法解析类型为 [...] 的字段 [...])
Elasticsearch含义
索引文档时,为某字段发送的值与 mapping 中为该字段定义的类型不匹配,无法解析。例如,向定义为 integer 的字段发送文本,或向定义为 date 的字段发送无效的日期格式。
原因
字段类型不匹配(数值字段收到字符串、日期字段格式错误)、日期与预期日期格式不匹配、JSON 格式错误/不完整、动态映射推断出错误类型,或在需要对象的地方发送了标量值。
解决方法
检查错误消息中的字段名和预期类型:GET /index-name/_mapping。使文档中的值与字段类型相符,或以正确类型重新定义 mapping。对于日期字段,使 format 参数与文档格式一致。已有字段的类型无法更改;必要时创建新索引,并用 _reindex 迁移数据。在应用层校验数据。
同一数据库的其他条目
- index_read_only_allow_deleteTOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block (legacy: FORBIDDEN/12/index read-only / allow delete (api))(磁盘使用超过 flood-stage 水位线,索引带有 read-only-allow-delete 块)
- high_disk_watermark_exceededhigh disk watermark [90%] exceeded / flood stage disk watermark [95%] exceeded(超过磁盘 high 水位线 [90%] / flood stage 水位线 [95%])
- circuit_breaking_exceptionCircuitBreakingException[[parent] Data too large, data for [<...>] would be [...], which is larger than the limit of [...]](数据过大,超过熔断器限制)
- strict_dynamic_mapping_exceptionstrict_dynamic_mapping_exception: mapping set to strict, dynamic introduction of [...] within [...] is not allowed(mapping 设为 strict,不允许动态添加字段)
- illegal_argument_exception_fielddataillegal_argument_exception: Fielddata is disabled on text fields by default. Set fielddata=true on [your_field] in order to load fielddata in memory(text 字段默认禁用 fielddata)
- search_phase_execution_exceptionsearch_phase_execution_exception: all shards failed / Failed to execute phase [query](所有分片均失败 / 执行 [query] 阶段失败)
- too_many_clausestoo_many_clauses: maxClauseCount is set to 1024 (query contains too many clauses)(查询包含的子句过多)