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

版本: 7.11-7.15

简要来说,当动态模板中定义了运行时字段,但未指定类型或类型不正确时,会出现此错误。Elasticsearch 要求在动态模板中为运行时字段定义类型。要解决此问题,您可以在动态模板中为运行时字段指定正确的类型,或者在不需要时删除运行时字段。此外,请确保您指定的类型是 Elasticsearch 支持的。

日志上下文 #

日志 “Dynamic template [” + name + “] defines a runtime field but type [” 类名是 DynamicTemplate.java。我们从 Elasticsearch 源代码中提取了以下内容,供寻求深入上下文的用户参考:

} else if (matchMappingType != null) {
 final XContentFieldType xContentFieldType;
 try {
 xContentFieldType = XContentFieldType.fromString(matchMappingType);
 if (runtime && xContentFieldType.supportsRuntimeField() == false) {
 throw new MapperParsingException("Dynamic template [" + name + "] defines a runtime field but type ["
 + xContentFieldType + "] is not supported as runtime field");
 }
 } catch (IllegalArgumentException e) {
 if (indexVersionCreated.onOrAfter(Version.V_6_0_0_alpha1)) {
 throw e;