{"record":{"id":"779a27f595b90bad","repo":"elastic/elasticsearch","slug":"unexpected-token-token-currentfieldname-in","errorCode":null,"errorMessage":"Unexpected token {token} [{currentFieldName}] in [{aggregationName}]. Multi-field aggregations do not support scripts.","messagePattern":"Unexpected token (.+?) \\[(.+?)\\] in \\[(.+?)\\]\\. Multi-field aggregations do not support scripts\\.","errorType":"validation","errorClass":"ParsingException","httpStatus":null,"severity":"error","filePath":"modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java","lineNumber":79,"sourceCode":"    @Override\n    public final ArrayValuesSourceAggregationBuilder<?> parse(String aggregationName, XContentParser parser) throws IOException {\n\n        List<String> fields = null;\n        String format = null;\n        Map<String, Object> missingMap = null;\n        Map<ParseField, Object> otherOptions = new HashMap<>();\n        XContentParser.Token token;\n        String currentFieldName = null;\n        while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {\n            if (token == XContentParser.Token.FIELD_NAME) {\n                currentFieldName = parser.currentName();\n            } else if (token == XContentParser.Token.VALUE_STRING) {\n                if (CommonFields.FIELDS.match(currentFieldName, parser.getDeprecationHandler())) {\n                    fields = Collections.singletonList(parser.text());\n                } else if (formattable && CommonFields.FORMAT.match(currentFieldName, parser.getDeprecationHandler())) {\n                    format = parser.text();\n                } else if (CommonFields.VALUE_TYPE.match(currentFieldName, parser.getDeprecationHandler())) {\n                    throw new ParsingException(\n                        parser.getTokenLocation(),\n                        \"Unexpected token \"\n                            + token\n                            + \" [\"\n                            + currentFieldName\n                            + \"] in [\"\n                            + aggregationName\n                            + \"]. \"\n                            + \"Multi-field aggregations do not support scripts.\"\n                    );\n                } else if (token(aggregationName, currentFieldName, token, parser, otherOptions) == false) {\n                    throw new ParsingException(\n                        parser.getTokenLocation(),\n                        \"Unexpected token \" + token + \" [\" + currentFieldName + \"] in [\" + aggregationName + \"].\"\n                    );\n                }\n            } else if (token == XContentParser.Token.START_OBJECT) {\n                if (CommonFields.MISSING.match(currentFieldName, parser.getDeprecationHandler())) {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java#L61-L97","documentation":"Error \"Unexpected token {token} [{currentFieldName}] in [{aggregationName}]. Multi-field aggregations do not support scripts.\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/ArrayValuesSourceParser.java:79 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-12T13:17:24.610Z"}