{"record":{"id":"44724514e79cc864","repo":"elastic/elasticsearch","slug":"empty-list-of-filters-provided-to-tokenfilter-na","errorCode":null,"errorMessage":"Empty list of filters provided to tokenfilter [{name}]","messagePattern":"Empty list of filters provided to tokenfilter \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ScriptedConditionTokenFilterFactory.java","lineNumber":51,"sourceCode":" */\npublic class ScriptedConditionTokenFilterFactory extends AbstractTokenFilterFactory {\n\n    private final AnalysisPredicateScript.Factory factory;\n    private final List<String> filterNames;\n\n    ScriptedConditionTokenFilterFactory(IndexSettings indexSettings, String name, Settings settings, ScriptService scriptService) {\n        super(name);\n\n        Settings scriptSettings = settings.getAsSettings(\"script\");\n        Script script = Script.parse(scriptSettings);\n        if (script.getType() != ScriptType.INLINE) {\n            throw new IllegalArgumentException(\"Cannot use stored scripts in tokenfilter [\" + name + \"]\");\n        }\n        this.factory = scriptService.compile(script, AnalysisPredicateScript.CONTEXT);\n\n        this.filterNames = settings.getAsList(\"filter\");\n        if (this.filterNames.isEmpty()) {\n            throw new IllegalArgumentException(\"Empty list of filters provided to tokenfilter [\" + name + \"]\");\n        }\n    }\n\n    @Override\n    public TokenStream create(TokenStream tokenStream) {\n        throw new UnsupportedOperationException(\"getChainAwareTokenFilterFactory should be called first\");\n    }\n\n    @Override\n    public TokenFilterFactory getChainAwareTokenFilterFactory(\n        IndexCreationContext context,\n        TokenizerFactory tokenizer,\n        List<CharFilterFactory> charFilters,\n        List<TokenFilterFactory> previousTokenFilters,\n        Function<String, TokenFilterFactory> allFilters\n    ) {\n        // Guard against a filter referring to itself (directly or via a cycle), which would otherwise\n        // recurse until the stack overflows and takes the node down.","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ScriptedConditionTokenFilterFactory.java#L33-L69","documentation":"Error \"Empty list of filters provided to tokenfilter [{name}]\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ScriptedConditionTokenFilterFactory.java:51 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"}