{"record":{"id":"55b300cf9853ec2f","repo":"chroma-core/chroma","slug":"deleting-fts-index-is-only-supported-on-document","errorCode":null,"errorMessage":"Deleting FTS index is only supported on #document key.","messagePattern":"Deleting FTS index is only supported on #document key\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/schema.ts","lineNumber":635,"sourceCode":"    // TODO: Consider removing these checks in the future to allow disabling vector and sparse vector indexes\n    // Temporarily disallow deleting vector index (both globally and per-key)\n    if (config instanceof VectorIndexConfig) {\n      throw new Error(\"Deleting vector index is not currently supported.\");\n    }\n\n    // Temporarily disallow deleting sparse vector index (both globally and per-key)\n    if (config instanceof SparseVectorIndexConfig) {\n      throw new Error(\n        \"Deleting sparse vector index is not currently supported.\",\n      );\n    }\n\n    // FTS deletion is only allowed on #document key\n    if (\n      config instanceof FtsIndexConfig &&\n      (!keyProvided || key !== DOCUMENT_KEY)\n    ) {\n      throw new Error(\"Deleting FTS index is only supported on #document key.\");\n    }\n\n    // TODO: Consider removing this check in the future to allow disabling all indexes for a key\n    // Disallow disabling all index types for a key (config=undefined, key=\"some_key\")\n    if (keyProvided && !configProvided && key) {\n      throw new Error(\n        `Cannot disable all index types for key '${key}'. Please specify a specific index configuration.`,\n      );\n    }\n\n    if (keyProvided && configProvided && key) {\n      this.setIndexForKey(key, config as IndexConfig, false);\n    } else if (!keyProvided && configProvided) {\n      this.setIndexInDefaults(config as IndexConfig, false);\n    }\n\n    return this;\n  }","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/schema.ts#L617-L653","documentation":"Thrown by Schema.deleteIndex() in the JS/TS client when you pass an FtsIndexConfig but the target key is missing or is not the reserved '#document' key. Full-text search (FTS) indexes only exist on the '#document' pseudo-key, so the client refuses to 'delete FTS' anywhere else. It is a local, synchronous guard — no server request is made.","triggerScenarios":"Calling schema.deleteIndex(new FtsIndexConfig()) with no key argument, or schema.deleteIndex(new FtsIndexConfig(), 'my_metadata_key'). The check at schema.ts:631 fires whenever config instanceof FtsIndexConfig and (key is undefined OR key !== '#document').","commonSituations":"Porting code from older Chroma versions where FTS was toggled globally without a key; assuming 'delete the FTS index of my documents field' works on an arbitrary key; copy-pasting a createIndex(new FtsIndexConfig(), '#document') call and switching the method to deleteIndex while renaming the key.","solutions":["Call deleteIndex with the exact reserved key: schema.deleteIndex(new FtsIndexConfig(), '#document')","If you meant to drop a different index type on a normal key, pass that config instead (e.g. new StringInvertedIndexConfig()) — note VectorIndexConfig and SparseVectorIndexConfig deletion is separately blocked","If you wanted to disable FTS globally in defaults, this is intentionally unsupported; disable per '#document' instead"],"exampleFix":"// before\nschema.deleteIndex(new FtsIndexConfig());\n// after\nschema.deleteIndex(new FtsIndexConfig(), \"#document\");","handlingStrategy":"validation","validationCode":"const DOCUMENT_KEY = \"#document\";\nfunction canDeleteIndex(config, key) {\n  if (config instanceof FtsIndexConfig) return key === DOCUMENT_KEY;\n  if (config instanceof VectorIndexConfig || config instanceof SparseVectorIndexConfig) return false;\n  return true;\n}","typeGuard":"const isFtsDeleteRequest = (c) => c instanceof FtsIndexConfig;\nconst isDocumentKey = (k) => k === \"#document\";","tryCatchPattern":"try { schema.deleteIndex(cfg, key); } catch (e) { if (e instanceof Error && /#document key/.test(e.message)) console.warn('FTS delete must target #document'); else throw e; }","preventionTips":["Keep a single helper that maps index config class to its allowed key ('#document' for FTS, no key for Vector)","Assert preconditions on (config, key) pairs before mutating the schema","Treat any key starting with '#' as system-managed in your own wrappers"],"tags":["chromadb","schema","fts","index-management","client-side-validation"],"backgroundTag":"invalid-index-configuration","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}