chroma-core/chroma · error · Error

Deleting FTS index is only supported on #document key.

Error message

Deleting FTS index is only supported on #document key.

What it means

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.

Source

Thrown at clients/new-js/packages/chromadb/src/schema.ts:635

    // 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.`,
      );
    }

    if (keyProvided && configProvided && key) {
      this.setIndexForKey(key, config as IndexConfig, false);
    } else if (!keyProvided && configProvided) {
      this.setIndexInDefaults(config as IndexConfig, false);
    }

    return this;
  }

View on GitHub (pinned to aecdd12c8a)

Solutions

  1. Call deleteIndex with the exact reserved key: schema.deleteIndex(new FtsIndexConfig(), '#document')
  2. 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
  3. If you wanted to disable FTS globally in defaults, this is intentionally unsupported; disable per '#document' instead

Example fix

// before
schema.deleteIndex(new FtsIndexConfig());
// after
schema.deleteIndex(new FtsIndexConfig(), "#document");
Defensive patterns

Strategy: validation

Validate before calling

const DOCUMENT_KEY = "#document";
function canDeleteIndex(config, key) {
  if (config instanceof FtsIndexConfig) return key === DOCUMENT_KEY;
  if (config instanceof VectorIndexConfig || config instanceof SparseVectorIndexConfig) return false;
  return true;
}

Type guard

const isFtsDeleteRequest = (c) => c instanceof FtsIndexConfig;
const isDocumentKey = (k) => k === "#document";

Try / catch

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; }

Prevention

When it happens

Trigger: 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').

Common situations: 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.

Related errors


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/55b300cf9853ec2f. Report an issue: GitHub.