{"record":{"id":"ce8d9bbf19a64f0d","repo":"elastic/elasticsearch","slug":"the-ngram-token-filter-name-was-deprecated-in-6","errorCode":null,"errorMessage":"The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. Please change the filter name to [ngram] instead.","messagePattern":"The \\[nGram\\] token filter name was deprecated in 6\\.4 and cannot be used in new indices\\. Please change the filter name to \\[ngram\\] instead\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java","lineNumber":286,"sourceCode":"        filters.put(\"hindi_normalization\", HindiNormalizationFilterFactory::new);\n        filters.put(\"hyphenation_decompounder\", requiresAnalysisSettings(HyphenationCompoundWordTokenFilterFactory::new));\n        filters.put(\"indic_normalization\", IndicNormalizationFilterFactory::new);\n        filters.put(\"keep\", requiresAnalysisSettings(KeepWordFilterFactory::new));\n        filters.put(\"keep_types\", requiresAnalysisSettings(KeepTypesFilterFactory::new));\n        filters.put(\"keyword_marker\", requiresAnalysisSettings(KeywordMarkerTokenFilterFactory::new));\n        filters.put(\"kstem\", KStemTokenFilterFactory::new);\n        filters.put(\"length\", LengthTokenFilterFactory::new);\n        filters.put(\"limit\", LimitTokenCountFilterFactory::new);\n        filters.put(\"lowercase\", LowerCaseTokenFilterFactory::new);\n        filters.put(\"min_hash\", MinHashTokenFilterFactory::new);\n        filters.put(\"multiplexer\", MultiplexerTokenFilterFactory::new);\n        filters.put(\"ngram\", NGramTokenFilterFactory::new);\n        filters.put(\"nGram\", (IndexSettings indexSettings, Environment environment, String name, Settings settings) -> {\n            return new NGramTokenFilterFactory(indexSettings, environment, name, settings) {\n                @Override\n                public TokenStream create(TokenStream tokenStream) {\n                    if (indexSettings.getIndexVersionCreated().onOrAfter(IndexVersions.V_8_0_0)) {\n                        throw new IllegalArgumentException(\n                            \"The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. \"\n                                + \"Please change the filter name to [ngram] instead.\"\n                        );\n                    } else {\n                        deprecationLogger.warn(\n                            DeprecationCategory.ANALYSIS,\n                            \"nGram_deprecation\",\n                            \"The [nGram] token filter name is deprecated and will be removed in a future version. \"\n                                + \"Please change the filter name to [ngram] instead.\"\n                        );\n                    }\n                    return super.create(tokenStream);\n                }\n\n            };\n        });\n        filters.put(\"pattern_capture\", requiresAnalysisSettings(PatternCaptureGroupTokenFilterFactory::new));\n        filters.put(\"pattern_replace\", requiresAnalysisSettings(PatternReplaceTokenFilterFactory::new));","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java#L268-L304","documentation":"Error \"The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. Please change the filter name to [ngram] instead.\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java:286 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"}