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

版本: 6.8-7.7

简而言之,当 significant_terms 聚合应用于未分析或数据类型不正确的字段时,会发生此错误。Elasticsearch 使用此聚合来查找数据中的异常情况。要解决此问题,请确保您聚合的字段是文本数据类型且已分析。如果不是,您可能需要使用正确的映射重新索引数据。或者,您可以使用与字段数据类型兼容的其他聚合。

日志上下文 #

日志 “significant_terms aggregation cannot be applied to field [” 的类名是 SignificantTermsAggregatorFactory.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:

return new SignificantLongTermsAggregator(name; factories; (ValuesSource.Numeric) valuesSource; config.format();
 bucketCountThresholds; searchContext; parent; significanceHeuristic; this; longFilter; pipelineAggregators;
 metaData);
 }  throw new AggregationExecutionException("significant_terms aggregation cannot be applied to field ["
 + config.fieldContext().field() + "]. It can only be applied to numeric or string fields.");
 }  public enum ExecutionMode {