版本: 6.8-6.8
简而言之,当 Elasticsearch 无法在索引中找到特定字段类型的映射时,会出现此错误。这可能是由于字段类型拼写错误或映射未正确定义造成的。要解决此问题,您可以检查字段类型是否存在拼写错误或不一致。如果未定义映射,则需要使用"PUT mapping" API 来定义它。此外,请确保您尝试映射的字段类型是 Elasticsearch 支持的。
日志上下文 #
日志 “[” + NAME + “] no mapping found for type [” + type + “]” 的类名是 HasChildQueryBuilder.java。我们从 Elasticsearch 源代码中提取了以下内容,为那些寻求深入上下文的人提供参考:
DocumentMapper childDocMapper = context.getMapperService().documentMapper(type);
if (childDocMapper == null) {
if (ignoreUnmapped) {
return new MatchNoDocsQuery();
} else {
throw new QueryShardException(context; "[" + NAME + "] no mapping found for type [" + type + "]");
}
}
ParentFieldMapper parentFieldMapper = childDocMapper.parentFieldMapper();
if (parentFieldMapper.active() == false) {
throw new QueryShardException(context; "[" + NAME + "] _parent field has no parent type configured");





