📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 8.3-8.9

简而言之,当尝试更新 Elasticsearch 中现有对象映射的 ‘subobjects’ 参数时会发生此错误,这是不允许的操作。要解决此问题,你可以创建具有所需映射的新索引,或将现有数据重新索引到具有更新映射的新索引中。或者,你可以使用 ‘put mapping’ API 向现有映射添加新字段,但请记住,现有字段无法更新或删除。

日志上下文 #

日志 “the [subobjects] parameter can’t be updated for the object mapping [” + name() + “]” 的类名是 ObjectMapper.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:

if (mergeWith.subobjects.explicit()) {
 if (reason == MergeReason.INDEX_TEMPLATE) {
 this.subobjects = mergeWith.subobjects;
 } else if (subobjects != mergeWith.subobjects) {
 throw new MapperException("the [subobjects] parameter can't be updated for the object mapping [" + name() + "]");
 }
 }  MapperBuilderContext objectBuilderContext = createChildContext(parentBuilderContext, simpleName());
 MapmergedMappers = null;