{"record":{"id":"aa323f4b600dc777","repo":"chroma-core/chroma","slug":"deleting-vector-index-is-not-currently-supported","errorCode":null,"errorMessage":"Deleting vector index is not currently supported.","messagePattern":"Deleting vector index is not currently supported\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/schema.ts","lineNumber":620,"sourceCode":"      key === DOCUMENT_KEY &&\n      !(config instanceof FtsIndexConfig)\n    ) {\n      throw new Error(\n        `Cannot delete index on special key '${key}' with this config. Only FtsIndexConfig is allowed for #document.`,\n      );\n    }\n\n    // Disallow any key starting with # (except #document which allows FTS deletion)\n    if (keyProvided && key && key.startsWith(\"#\") && key !== DOCUMENT_KEY) {\n      throw new Error(\n        \"key cannot begin with '#'. Keys starting with '#' are reserved for system use.\",\n      );\n    }\n\n    // 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","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/schema.ts#L602-L638","documentation":"Deleting the vector index — globally or on any key — is temporarily unsupported; the source marks the restriction with a TODO indicating it may be lifted in a future version. Any deleteIndex call whose config is a VectorIndexConfig throws before anything is removed.","triggerScenarios":"schema.deleteIndex(new VectorIndexConfig()); schema.deleteIndex(new VectorIndexConfig(), 'any_key'); cleanup or migration scripts written against an assumed deletion API.","commonSituations":"Reset/reindex workflows that try to strip indexes before re-adding them; toggling ANN search off during bulk writes; scripts written for a newer client version run against this one.","solutions":["Recreate the collection with a Schema that omits or changes the vector index config, then re-ingest the data.","To change parameters, apply a new global VectorIndexConfig via createIndex instead of deleting.","Track the client changelog — the TODO in schema.ts signals deletion support may arrive later."],"exampleFix":"// before\nschema.deleteIndex(new VectorIndexConfig()); // throws\n\n// after\nconst freshSchema = new Schema(); // rebuild without the vector index override\nawait client.createCollection({ name: name + '_v2', schema: freshSchema });\n// then re-ingest documents into the new collection","handlingStrategy":"fallback","validationCode":"function assertDeletableIndex(config: IndexConfig): void {\n  if (config instanceof VectorIndexConfig) {\n    throw new Error('Vector index deletion is unsupported — recreate the collection instead');\n  }\n}","typeGuard":"const isDeletableIndex = (config: IndexConfig): boolean =>\n  !(config instanceof VectorIndexConfig);","tryCatchPattern":"try {\n  schema.deleteIndex(config, key);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Deleting vector index is not currently supported.') {\n    // fall back: create a new collection with the desired schema and re-ingest\n  } else {\n    throw e;\n  }\n}","preventionTips":["In this version only FTS on '#document' is a supported delete target — encode that in a wrapper.","Design reindexing flows around collection recreation, not index deletion.","Watch the changelog: the TODO in schema.ts marks this restriction as temporary."],"tags":["schema","index-config","vector-index","unsupported-operation","chroma"],"backgroundTag":"unsupported-index-operation","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}