📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8

简而言之,当您尝试在 Elasticsearch 中未映射为嵌套类型的字段上执行嵌套查询时,会出现此错误。Elasticsearch 要求对嵌套字段进行显式映射。要解决此问题,您可以更改查询,不对非嵌套字段使用嵌套查询,也可以使用正确的嵌套映射重新索引数据。请记住,更改映射需要重新索引数据。

日志上下文 #

日志 “[nested] nested path [” + path + “] is not nested” 的类名是 NestedAggregationBuilder.java。 我们从 Elasticsearch 源代码中提取了以下内容,供寻求深入上下文的用户参考:

// in case the path has been unmapped:
return new NestedAggregatorFactory(name; null; null; context; parent; subFactoriesBuilder; metadata);
}  if (childObjectMapper.isNested() == false) {
    throw new AggregationExecutionException("[nested] nested path [" + path + "] is not nested");
}
try {
    NestedObjectMapper parentObjectMapper = context.nestedScope().nextLevel((NestedObjectMapper) childObjectMapper);
    return new NestedAggregatorFactory(
        name;