chroma-core/chroma · error · Error
Deleting sparse vector index is not currently supported.
Error message
Deleting sparse vector index is not currently supported.
What it means
The sparse-vector twin of the vector-delete restriction: deleting a sparse vector index is not currently supported in any form (globally or per-key). Any deleteIndex call whose config is a SparseVectorIndexConfig throws immediately; the only deletable index in this version is FTS on '#document'.
Source
Thrown at clients/new-js/packages/chromadb/src/schema.ts:625
);
}
// Disallow any key starting with # (except #document which allows FTS deletion)
if (keyProvided && key && key.startsWith("#") && key !== DOCUMENT_KEY) {
throw new Error(
"key cannot begin with '#'. Keys starting with '#' are reserved for system use.",
);
}
// TODO: Consider removing these checks in the future to allow disabling vector and sparse vector indexes
// Temporarily disallow deleting vector index (both globally and per-key)
if (config instanceof VectorIndexConfig) {
throw new Error("Deleting vector index is not currently supported.");
}
// Temporarily disallow deleting sparse vector index (both globally and per-key)
if (config instanceof SparseVectorIndexConfig) {
throw new Error(
"Deleting sparse vector index is not currently supported.",
);
}
// FTS deletion is only allowed on #document key
if (
config instanceof FtsIndexConfig &&
(!keyProvided || key !== DOCUMENT_KEY)
) {
throw new Error("Deleting FTS index is only supported on #document key.");
}
// TODO: Consider removing this check in the future to allow disabling all indexes for a key
// Disallow disabling all index types for a key (config=undefined, key="some_key")
if (keyProvided && !configProvided && key) {
throw new Error(
`Cannot disable all index types for key '${key}'. Please specify a specific index configuration.`,
);View on GitHub (pinned to aecdd12c8a)
Solutions
- Recreate the collection with a schema that omits the sparse index, then re-ingest.
- If you only need different parameters, apply a new SparseVectorIndexConfig via createIndex on the same key instead of deleting.
- Version-gate teardown logic until the restriction (marked TODO in schema.ts) is lifted.
Example fix
// before
schema.deleteIndex(new SparseVectorIndexConfig(), 'sparse_embedding'); // throws
// after
// no delete API for sparse indexes yet — recreate the collection instead
const freshSchema = new Schema();
await client.createCollection({ name: name + '_v2', schema: freshSchema }); Defensive patterns
Strategy: fallback
Validate before calling
function assertDeletableIndex(config: IndexConfig): void {
if (config instanceof SparseVectorIndexConfig) {
throw new Error('Sparse index deletion is unsupported — recreate the collection instead');
}
} Type guard
const isDeletableIndex = (config: IndexConfig): boolean => !(config instanceof SparseVectorIndexConfig);
Try / catch
try {
schema.deleteIndex(config, key);
} catch (e) {
if (e instanceof Error && e.message === 'Deleting sparse vector index is not currently supported.') {
// fall back: create a new collection without the sparse index and re-ingest
} else {
throw e;
}
} Prevention
- Reconfigure sparse indexes via createIndex with a new SparseVectorIndexConfig rather than delete-then-recreate.
- Version-gate teardown logic; the TODO in schema.ts indicates deletion support may be added later.
When it happens
Trigger: schema.deleteIndex(new SparseVectorIndexConfig(), 'sparse_embedding'); reconfiguration workflows for hybrid search that delete-then-recreate sparse indexes.
Common situations: Hybrid (dense+sparse) search reconfiguration; teardown scripts written before checking which delete paths are actually supported.
Related errors
- Sparse vector index must be created on a specific key. Pleas
- Deleting vector index is not currently supported.
- Cannot enable all index types globally. Must specify either
- Cannot create index on special key '${key}'. This key is man
- Cannot create index on special key '${key}' with this config
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/93fdd88caa6fa05f.
Report an issue: GitHub.