版本: 8.9-8.9
简而言之,当 Elasticsearch 中的映射对象深度超过限制时会发生此错误。这通常是由于你拥有过多的嵌套字段或对象造成的。要解决此问题,你可以减少映射中的嵌套字段或对象数量,或者通过调整 Elasticsearch 配置中的 ‘index.mapping.depth.limit’ 设置来增加映射深度限制。然而,增加限制应谨慎操作,因为它可能会影响 Elasticsearch 集群的性能。
日志上下文 #
日志 “Limit of mapping depth [” + mappingObjectDepthLimit + “] has been exceeded” 的类名是 MappingParserContext.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
} void incrementMappingObjectDepth() throws MapperParsingException {
mappingObjectDepth++;
if (mappingObjectDepth > mappingObjectDepthLimit) {
throw new MapperParsingException("Limit of mapping depth [" + mappingObjectDepthLimit + "] has been exceeded");
}
} void decrementMappingObjectDepth() throws MapperParsingException {
mappingObjectDepth--;





