版本: 6.8-6.8
简要来说,当在 Elasticsearch 查询中指定了不正确或不存在的聚合路径时,会发生此错误。“terms” 聚合的 “order” 子句中指定的路径未被识别。要解决此问题,请确保 “order” 子句中指定的路径正确且存在于查询中。同时,检查聚合名称是否存在拼写错误或大小写不正确的情况。如果聚合定义在不同的作用域中,您可能需要调整查询的结构。
日志上下文 #
日志 “Invalid aggregator order path [” + this + “]. Unknown aggregation [” 的类名是 AggregationPath.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的用户参考:
public void validate(Aggregator root) throws AggregationExecutionException {
Aggregator aggregator = root;
for (int i = 0; i < pathElements.size(); i++) {
aggregator = ProfilingAggregator.unwrap(aggregator.subAggregator(pathElements.get(i).name));
if (aggregator == null) {
throw new AggregationExecutionException("Invalid aggregator order path [" + this + "]. Unknown aggregation ["
+ pathElements.get(i).name + "]");
}
if (i < pathElements.size() - 1) { // we're in the middle of the path; so the aggregator can only be a single-bucket aggregator





