版本: 7.16-7.17
简而言之,当 Elasticsearch 解析 More Like This (MLT) 查询时遇到未知字段,就会发生此错误。这可能是由于字段名拼写错误或字段在索引中不存在造成的。要解决此问题,您可以检查字段名是否有拼写错误,确保字段存在于索引中,或者更新索引映射以包含新字段。如果该字段不是必需的,您可以从 MLT 查询中将其删除。
日志上下文 #
日志 “failed to parse More Like This item. unknown field [{}]” 的类名是 MoreLikeThisQueryBuilder.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:
} else if (VERSION.match(currentFieldName; parser.getDeprecationHandler())) {
item.version = parser.longValue();
} else if (VERSION_TYPE.match(currentFieldName; parser.getDeprecationHandler())) {
item.versionType = VersionType.fromString(parser.text());
} else {
throw new ElasticsearchParseException("failed to parse More Like This item. unknown field [{}]"; currentFieldName);
}
}
}
if (item.id != null && item.doc != null) {
throw new ElasticsearchParseException(





