elastic/elasticsearch · error · IllegalArgumentException
neither field {fieldX} nor {fieldY} exist
Error message
neither field {fieldX} nor {fieldY} exist What it means
Error "neither field {fieldX} nor {fieldY} exist" thrown in elastic/elasticsearch.
Source
Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsResults.java:171
/** return the correlations as a map - not public, used for getProperty() */
protected Map<String, HashMap<String, Double>> getCorrelations() {
return Collections.unmodifiableMap(correlation);
}
/** return the correlation coefficient between two fields */
public Double getCorrelation(String fieldX, String fieldY) {
if (fieldX.equals(fieldY)) {
return 1.0;
}
return getValFromUpperTriangularMatrix(correlation, fieldX, fieldY);
}
/** return the value for two fields in an upper triangular matrix, regardless of row col location. */
static <M extends Map<String, Double>> double getValFromUpperTriangularMatrix(Map<String, M> map, String fieldX, String fieldY) {
// for the co-value to exist, one of the two (or both) fields has to be a row key
if (map.containsKey(fieldX) == false && map.containsKey(fieldY) == false) {
throw new IllegalArgumentException("neither field " + fieldX + " nor " + fieldY + " exist");
} else if (map.containsKey(fieldX)) {
// fieldX exists as a row key
if (map.get(fieldX).containsKey(fieldY)) {
// fieldY exists as a col key to fieldX
return map.get(fieldX).get(fieldY);
} else {
// otherwise fieldX is the col key to fieldY
return map.get(fieldY).get(fieldX);
}
} else if (map.containsKey(fieldY)) {
// fieldX did not exist as a row key, it must be a col key
return map.get(fieldY).get(fieldX);
}
throw new IllegalArgumentException("Coefficient not computed between fields: " + fieldX + " and " + fieldY);
}
private static void checkField(String field, Map<String, ?> map) {
if (field == null) {View on GitHub (pinned to db6a809a66)
When it happens
Trigger: Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsResults.java:171 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/14381050edeb91ea.
Report an issue: GitHub.