{"record":{"id":"5324e3ee2cee3cc8","repo":"chroma-core/chroma","slug":"cannot-create-index-on-special-key-key-with-th","errorCode":null,"errorMessage":"Cannot create index on special key '{key}' with this config. Only FtsIndexConfig is allowed for #document.","messagePattern":"Cannot create index on special key '(.+?)' with this config\\. Only FtsIndexConfig is allowed for #document\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/types.py","lineNumber":2150,"sourceCode":"\n        if key is not None and isinstance(key, KeyType):\n            key = key.name\n\n        # Disallow config=None and key=None - too dangerous\n        if config is None and key is None:\n            raise ValueError(\n                \"Cannot enable all index types globally. Must specify either config or key.\"\n            )\n\n        # Disallow using special internal key #embedding\n        if key is not None and key == EMBEDDING_KEY:\n            raise ValueError(\n                f\"Cannot create index on special key '{key}'. This key is managed automatically by the system. Invoke create_index(VectorIndexConfig(...)) without specifying a key to configure the vector index globally.\"\n            )\n\n        # Only allow #document with FtsIndexConfig\n        if key == DOCUMENT_KEY and not isinstance(config, FtsIndexConfig):\n            raise ValueError(\n                f\"Cannot create index on special key '{key}' with this config. \"\n                \"Only FtsIndexConfig is allowed for #document.\"\n            )\n\n        # Disallow any key starting with # (except #document which allows FTS)\n        if key is not None and key.startswith(\"#\") and key != DOCUMENT_KEY:\n            raise ValueError(\n                \"key cannot begin with '#'. \"\n                \"Keys starting with '#' are reserved for system use.\"\n            )\n\n        # Special handling for vector index\n        if isinstance(config, VectorIndexConfig):\n            if key is None:\n                # Allow setting vector config globally - it applies to defaults and #embedding\n                # but doesn't change enabled state (vector index is always enabled on #embedding)\n                self._set_vector_index_config(config)\n                return self","sourceCodeStart":2132,"sourceCodeEnd":2168,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/types.py#L2132-L2168","documentation":"Error \"Cannot create index on special key '{key}' with this config. Only FtsIndexConfig is allowed for #document.\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/api/types.py:2150 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":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}