版本: 6.8-8.9
简而言之,当 terms 聚合查询中的参数 [min_doc_count] 和 [shardMinDocCount] 被设置为负值时,会出现此错误。这两个参数都应该大于或等于零。要解决此问题,你应该检查查询并确保 [min_doc_count] 和 [shardMinDocCount] 都设置为零或正整数。如果它们被设置为负值,请将它们更改为非负值。
日志上下文 #
日志 “parameter [min_doc_count] and [shardMinDocCount] must be >=0 in terms aggregation.” 的类名是 TermsAggregator.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:
if (requiredSize <= 0 || shardSize <= 0) {
throw new ElasticsearchException("parameters [required_size] and [shard_size] must be >0 in terms aggregation.");
} if (minDocCount < 0 || shardMinDocCount < 0) {
throw new ElasticsearchException("parameter [min_doc_count] and [shardMinDocCount] must be >=0 in terms aggregation.");
}
} /**
* The minimum number of documents a bucket must have in order to





