--- title: "Dense ords 不知道如何从多个桶中收集数据 – 如何解决此 Elasticsearch 异常" date: 2026-03-30 lastmod: 2026-03-30 description: "当尝试使用 dense ords 不支持的功能时会出现此错误。Dense ords 是 Elasticsearch 中用于存储和检索数据的数据结构类型,它们并非设计用于一次性从多个桶收集数据。" tags: ["聚合异常", "密集序号", "全局序号", "桶聚合"] summary: " 版本: 7.9-8.9 简要来说,当您尝试使用 dense ords 不支持的 Elasticsearch 功能时,会出现此错误。Dense ords 是 Elasticsearch 中用于存储和检索数据的一种数据结构类型。它们并非设计用于一次性从多个桶收集数据。要解决此问题,您可以尝试重构查询,一次从一个桶收集数据,或者考虑使用支持从多个桶收集的不同数据结构。另外,您可以尝试减少正在收集的桶的数量。 日志上下文 # 日志 “Dense ords don’t know how to collect from many buckets” 的类名是 GlobalOrdinalsStringTermsAggregator.java。 我们从 Elasticsearch 源代码中提取了以下内容,供寻求深入背景的人参考: if (remapGlobalOrds) { this.collectionStrategy = new RemapGlobalOrds(cardinality); } else { this.collectionStrategy = cardinality.map(estimate -> { if (estimate > 1) { throw new AggregationExecutionException("Dense ords don't know how to collect from many buckets"); } return new DenseGlobalOrds(); }); } " --- > **版本:** 7.9-8.9 简要来说,当您尝试使用 dense ords 不支持的 Elasticsearch 功能时,会出现此错误。Dense ords 是 Elasticsearch 中用于存储和检索数据的一种数据结构类型。它们并非设计用于一次性从多个桶收集数据。要解决此问题,您可以尝试重构查询,一次从一个桶收集数据,或者考虑使用支持从多个桶收集的不同数据结构。另外,您可以尝试减少正在收集的桶的数量。 日志上下文 ----------- 日志 "Dense ords don't know how to collect from many buckets" 的类名是 [GlobalOrdinalsStringTermsAggregator.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供寻求深入背景的人参考: ```java if (remapGlobalOrds) { this.collectionStrategy = new RemapGlobalOrds(cardinality); } else { this.collectionStrategy = cardinality.map(estimate -> { if (estimate > 1) { throw new AggregationExecutionException("Dense ords don't know how to collect from many buckets"); } return new DenseGlobalOrds(); }); } ```