Aggregation name cannot support – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.3-7.7

Briefly, this error occurs when you’re trying to perform an aggregation operation that is not supported by the specific field type in Elasticsearch. This could be due to the field being analyzed or not being of the correct data type. To resolve this issue, you can either change the field type to one that supports the desired aggregation or modify the aggregation query to fit the current field type. Alternatively, you can create a non-analyzed version of the field specifically for aggregation purposes.

This guide will help you check for common problems that cause the log ” Aggregation [” + name + “] cannot support ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: search, aggregations.

Log Context

Log “Aggregation [” + name + “] cannot support ” class name is RareTermsAggregatorFactory.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (valuesSource instanceof ValuesSource.Bytes) {
 ExecutionMode execution = ExecutionMode.MAP; //TODO global ords not implemented yet; only supports "map"  DocValueFormat format = config.format();
 if ((includeExclude != null) && (includeExclude.isRegexBased()) && format != DocValueFormat.RAW) {
 throw new AggregationExecutionException("Aggregation [" + name + "] cannot support " +
 "regular expression style include/exclude settings as they can only be applied to string fields. " +
 "Use an array of values for include/exclude clauses");
 }  return execution.create(name; factories; valuesSource; format;

 

 [ratemypost]