版本: 7.9-8.9
简要来说,当您尝试在 Elasticsearch 的嵌套对象映射上更新 [include_in_root] 参数时会发生此错误。该参数一旦设置就不可更改。要解决此问题,您可以使用正确的设置重新创建索引,或者创建具有所需设置的新索引,并将数据从旧索引重新索引到新索引。始终确保仔细规划索引结构以避免此类问题。
日志上下文 #
日志 “the [include_in_root] parameter can’t be updated on a nested object mapping” 的类名是 NestedObjectMapper.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:
} else {
if (includeInParent.value() != mergeWithObject.includeInParent.value()) {
throw new MapperException("the [include_in_parent] parameter can't be updated on a nested object mapping");
}
if (includeInRoot.value() != mergeWithObject.includeInRoot.value()) {
throw new MapperException("the [include_in_root] parameter can't be updated on a nested object mapping");
}
}
if (parentBuilderContext instanceof NestedMapperBuilderContext nc) {
if (nc.parentIncludedInRoot && toMerge.includeInParent.value()) {
toMerge.includeInRoot = Explicit.IMPLICIT_FALSE;





