{"record":{"id":"93cf340cb1dfded2","repo":"elastic/elasticsearch","slug":"found-unknown-path-element-element-in-getnam","errorCode":null,"errorMessage":"Found unknown path element [{element}] in [{getName()}]","messagePattern":"Found unknown path element \\[(.+?)\\] in \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/InternalMatrixStats.java","lineNumber":216,"sourceCode":"        if (path.isEmpty()) {\n            return this;\n        } else if (path.size() == 2) {\n            if (results == null) {\n                return emptyMap();\n            }\n            final String field = path.get(0)\n                .replaceAll(\"^[\\\"']+\", \"\") // remove leading \" and '\n                .replaceAll(\"[\\\"']+$\", \"\"); // remove trailing \" and '\n            final String element = path.get(1);\n            return switch (element) {\n                case \"counts\" -> results.getFieldCount(field);\n                case \"means\" -> results.getMean(field);\n                case \"variances\" -> results.getVariance(field);\n                case \"skewness\" -> results.getSkewness(field);\n                case \"kurtosis\" -> results.getKurtosis(field);\n                case \"covariance\" -> results.getCovariance(field, field);\n                case \"correlation\" -> results.getCorrelation(field, field);\n                default -> throw new IllegalArgumentException(\"Found unknown path element [\" + element + \"] in [\" + getName() + \"]\");\n            };\n        } else if (path.size() == 1) {\n            String element = path.get(0);\n            if (results == null) {\n                return emptyMap();\n            }\n            return switch (element) {\n                case \"counts\" -> results.getFieldCounts();\n                case \"means\" -> results.getMeans();\n                case \"variances\" -> results.getVariances();\n                case \"skewness\" -> results.getSkewness();\n                case \"kurtosis\" -> results.getKurtosis();\n                case \"covariance\" -> results.getCovariances();\n                case \"correlation\" -> results.getCorrelations();\n                default -> throw new IllegalArgumentException(\"Found unknown path element [\" + element + \"] in [\" + getName() + \"]\");\n            };\n        } else {\n            throw new IllegalArgumentException(\"path not supported for [\" + getName() + \"]: \" + path);","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/InternalMatrixStats.java#L198-L234","documentation":"Error \"Found unknown path element [{element}] in [{getName()}]\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/InternalMatrixStats.java:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}