ValuesSource type – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.8-7.15

Briefly, this error occurs when there’s a mismatch between the field type in the index mapping and the field type expected by the aggregation or query. For instance, you might be trying to perform a numeric aggregation on a text field. To resolve this, ensure that the field type in your query matches the field type in your index mapping. If necessary, reindex your data with the correct field types. Alternatively, you could use a script to convert the field type during the query or aggregation.

This guide will help you check for common problems that cause the log ” ValuesSource type ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: aggregations, search, source.

Log Context

Log “ValuesSource type” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public NumericMultiValuesSource(Map valuesSourceConfigs) {
 values = new HashMap<>(valuesSourceConfigs.size());
 for (Map.Entry entry : valuesSourceConfigs.entrySet()) {
 final ValuesSource valuesSource = entry.getValue().getValuesSource();
 if (valuesSource instanceof ValuesSource.Numeric == false) {
 throw new AggregationExecutionException("ValuesSource type " + valuesSource.toString() +
 "is not supported for multi-valued aggregation");
 values.put(entry.getKey(); (ValuesSource.Numeric) valuesSource);


How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?