{"record":{"id":"b153f6f9a387c9b5","repo":"lancedb/lancedb","slug":"unknown-index-type-index-type-b153f6","errorCode":null,"errorMessage":"Unknown index type {index_type}","messagePattern":"Unknown index type (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/python/lancedb/table.py","lineNumber":3326,"sourceCode":"                max_iterations=max_iterations,\n                sample_rate=sample_rate,\n                m=m,\n                ef_construction=ef_construction,\n                target_partition_size=target_partition_size,\n                accelerator=accelerator,\n            )\n        elif index_type == \"IVF_HNSW_FLAT\":\n            return HnswFlat(\n                distance_type=metric,\n                num_partitions=num_partitions,\n                max_iterations=max_iterations,\n                sample_rate=sample_rate,\n                m=m,\n                ef_construction=ef_construction,\n                target_partition_size=target_partition_size,\n            )\n        else:\n            raise ValueError(f\"Unknown index type {index_type}\")\n\n    def drop_index(self, name: str) -> None:\n        \"\"\"\n        Drops an index from the table\n\n        Parameters\n        ----------\n        name: str\n            The name of the index to drop\n        \"\"\"\n        return LOOP.run(self._table.drop_index(name))\n\n    def prewarm_index(self, name: str) -> None:\n        \"\"\"\n        Prewarm an index in the table.\n\n        This is a hint to the database that the index will be accessed in the\n        future and should be loaded into memory if possible.  This can reduce","sourceCodeStart":3308,"sourceCodeEnd":3344,"githubUrl":"https://github.com/lancedb/lancedb/blob/c7b051aff7039333a3f61b79217246c27676806a/python/python/lancedb/table.py#L3308-L3344","documentation":"The legacy create_index path dispatches on index_type and only supports the recognized vector index variants (IVF_PQ, IVF_HNSW_PQ, etc.); anything else raises ValueError('Unknown index type {index_type}').","triggerScenarios":"Calling table.create_index(metric=..., vector_column_name=..., index_type=X) where X is not one of the accepted strings (e.g. 'IVFPQ', 'hnsw', lowercase 'ivf_pq', or a scalar type like 'BTREE' on this legacy path).","commonSituations":"Copy-pasted index_type from another library (FAISS/pgvector style); case mistakes; trying to create a scalar index (BTREE/BITMAP/LABEL_LIST) through the legacy vector API instead of the config-based create_index.","solutions":["Use one of the accepted index_type strings (e.g. \"IVF_PQ\", \"IVF_HNSW_PQ\", \"IVF_HNSW_SQ\").","Prefer the config-based API: table.create_index(column, config=IvfPq(...)) instead of index_type strings.","For scalar indexes use BTree/Bitmap/LabelList configs with create_index(column=...).","Check the signature/docs of your installed lancedb version; index_type names changed over releases."],"exampleFix":"// before\ntable.create_index(num_partitions=16, index_type=\"IVFPQ\")\n// after\nfrom lancedb.index import IvfPq\ntable.create_index(metric=\"L2\", vector_column_name=\"vector\",\n                   index_type=\"IVF_PQ\")\n# or config-based:\ntable.create_index(config=IvfPq(num_partitions=16))","handlingStrategy":"validation","validationCode":"ALLOWED = {\"IVF_PQ\", \"IVF_HNSW_PQ\", \"IVF_HNSW_SQ\"}\nif index_type not in ALLOWED:\n    raise ValueError(f\"index_type must be one of {ALLOWED}\")","typeGuard":null,"tryCatchPattern":"try:\n    table.create_index(index_type=index_type, ...)\nexcept ValueError as e:\n    if \"Unknown index type\" in str(e):\n        logger.error(f\"Unsupported index_type: {index_type}\")","preventionTips":["Prefer config objects (IvfPq etc.) over raw index_type strings.","Keep index_type values in a validated enum/constants module.","Check the docs for your installed lancedb version."],"tags":["python","index","invalid-enum-value","valueerror"],"backgroundTag":"invalid-enum-value","analyzedSha":"c7b051aff7039333a3f61b79217246c27676806a","analyzedAt":"2026-09-08T23:42:37.579Z","contentChangedAt":"2026-09-08T23:42:37.579Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}