{"record":{"id":"335b30ff6332aa4c","repo":"elastic/elasticsearch","slug":"the-product-of-hash-count-bucket-count","errorCode":null,"errorMessage":"The product of hash_count [{}], bucket_count [{}], and hash_set_size [{}] is [{}], which exceeds the maximum token count limit [{}]. This limit can be set by changing the [{}] index level setting.","messagePattern":"The product of hash_count \\[(.+?)\\], bucket_count \\[(.+?)\\], and hash_set_size \\[(.+?)\\] is \\[(.+?)\\], which exceeds the maximum token count limit \\[(.+?)\\]\\. This limit can be set by changing the \\[(.+?)\\] index level setting\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MinHashTokenFilterFactory.java","lineNumber":43,"sourceCode":" *\n */\npublic class MinHashTokenFilterFactory extends AbstractTokenFilterFactory {\n\n    private final MinHashFilterFactory minHashFilterFactory;\n\n    MinHashTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {\n        super(name);\n        int hashCount = settings.getAsInt(\"hash_count\", MinHashFilter.DEFAULT_HASH_COUNT);\n        int bucketCount = settings.getAsInt(\"bucket_count\", MinHashFilter.DEFAULT_BUCKET_COUNT);\n        int hashSetSize = settings.getAsInt(\"hash_set_size\", MinHashFilter.DEFAULT_HASH_SET_SIZE);\n        // Only validate when the user explicitly configured parameters; eager instantiation with\n        // default settings (empty Settings) is skipped so that an unrelated low max_token_count\n        // on an index that doesn't use min_hash does not cause index creation to fail.\n        if (settings.hasValue(\"hash_count\") || settings.hasValue(\"bucket_count\") || settings.hasValue(\"hash_set_size\")) {\n            long maxTokenCount = indexSettings.getMaxTokenCount();\n            long maxOutputTokens = (long) hashCount * bucketCount * hashSetSize;\n            if (maxOutputTokens > maxTokenCount) {\n                throw new IllegalArgumentException(\n                    \"The product of hash_count [\"\n                        + hashCount\n                        + \"], bucket_count [\"\n                        + bucketCount\n                        + \"], and hash_set_size [\"\n                        + hashSetSize\n                        + \"] is [\"\n                        + maxOutputTokens\n                        + \"], which exceeds the maximum token count limit [\"\n                        + maxTokenCount\n                        + \"]. This limit can be set by changing the [\"\n                        + IndexSettings.MAX_TOKEN_COUNT_SETTING.getKey()\n                        + \"] index level setting.\"\n                );\n            }\n        }\n        minHashFilterFactory = new MinHashFilterFactory(convertSettings(settings));\n    }","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MinHashTokenFilterFactory.java#L25-L61","documentation":"Error \"The product of hash_count [{}], bucket_count [{}], and hash_set_size [{}] is [{}], which exceeds the maximum token count limit [{}]. This limit can be set by changing the [{}] index level setting.\" thrown in elastic/elasticsearch.","triggerScenarios":"Thrown at modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MinHashTokenFilterFactory.java:43 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"}