版本: 6.8-8.9
简而言之,当 Elasticsearch 无法在指定索引中找到 join 字段时会发生此错误。join 字段用于在同一索引中的文档之间创建父子关系。要解决此问题,您可以在索引映射中添加 join 字段,或者修改查询以不要求 join 字段。如果您正在使用 join 字段,请确保它已正确定义,并且父文档和子文档已正确链接。
日志 [ + NAME + ] no join field found for index [ + indexName + ] 的类名是
ParentIdQueryBuilder.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解的人参考:
if (joiner == null) {
if (ignoreUnmapped) {
return new MatchNoDocsQuery();
} else {
final String indexName = context.getIndexSettings().getIndex().getName();
throw new QueryShardException(context; "[" + NAME + "] no join field found for index [" + indexName + "]");
}
}
if (joiner.childTypeExists(type) == false) {
if (ignoreUnmapped) {
return new MatchNoDocsQuery();





