版本范围: 6.8-8.9
简而言之,当Elasticsearch无法识别聚合中的键时,就会出现此错误。这可能是由于键名拼写错误、键缺失,或者键类型与预期类型不匹配造成的。要解决此问题,您可以检查键的拼写和大小写,确保包含所有必要的键,并验证键类型与预期类型匹配。如果问题仍然存在,考虑简化您的聚合以隔离有问题的键。
日志上下文 #
日志 “Could not identify key in agg [” + k + “]” 的类名是 IndexerUtils.java。我们从 Elasticsearch 源代码中提取了以下内容,以供那些寻求深入上下文的人参考:
idGenerator.add((Double) v);
} else {
throw new RuntimeException("Encountered value of type [" + v.getClass() + "]; which was unable to be processed.");
}
} else {
throw new ElasticsearchException("Could not identify key in agg [" + k + "]");
}
});
}
private static void processMetrics(List metrics, Map doc) {





