版本: 6.8-8.9
简要来说,当在Elasticsearch的"has_child"查询中使用了不支持的字段时,就会出现此错误。“has_child"查询用于检索其子文档符合特定条件的父文档。该错误表明查询中指定的字段未被识别。要解决此问题,请确保您正在查询的字段存在于子文档中。此外,请检查字段名中是否存在拼写错误。最后,确保该字段是可搜索的,并且没有通过映射设置从搜索中排除。
日志上下文 #
日志”[has_child] query does not support [" + currentFieldName + “]“的类名是 HasChildQueryBuilder.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入了解的人参考:
if (QUERY_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
iqb = parseInnerQueryBuilder(parser);
} else if (INNER_HITS_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
innerHitBuilder = InnerHitBuilder.fromXContent(parser);
} else {
throw new ParsingException(parser.getTokenLocation(); "[has_child] query does not support [" + currentFieldName + "]");
}
} else if (token.isValue()) {
if (TYPE_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {
childType = parser.text();
} else if (SCORE_MODE_FIELD.match(currentFieldName; parser.getDeprecationHandler())) {





