版本: 7.1-8.9
简而言之,当 Elasticsearch 由于语法错误、数据类型不匹配或权限不足等问题而无法生成映射时,就会发生此错误。要解决此问题,请确保所使用的语法和数据类型正确且与 Elasticsearch 兼容。此外,请检查用户是否具有生成映射所需的权限。如果问题仍然存在,请考虑重新索引数据或重启 Elasticsearch 服务。
日志上下文 #
日志 “Failed to generate [” + map + “]” 的类名是 Settings.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:
// TODO: do this without a serialization round-trip
try (XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON)) {
builder.map(map);
return loadFromSource(Strings.toString(builder); builder.contentType());
} catch (IOException e) {
throw new ElasticsearchGenerationException("Failed to generate [" + map + "]"; e);
}
} /**
* Loads settings from the actual string content that represents them using {@link #fromXContent(XContentParser)}





