From 16cf2990f3bf66bf4d6ae7ff63caa115889b0eed Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Wed, 25 Dec 2024 14:57:07 +0800 Subject: [PATCH] feat: create IVF_FLAT on remote table (#1978) Signed-off-by: BubbleCal --- python/python/lancedb/remote/table.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/python/lancedb/remote/table.py b/python/python/lancedb/remote/table.py index 73236e9b..71d4b6be 100644 --- a/python/python/lancedb/remote/table.py +++ b/python/python/lancedb/remote/table.py @@ -19,7 +19,7 @@ import warnings from lancedb._lancedb import IndexConfig from lancedb.embeddings.base import EmbeddingFunctionConfig -from lancedb.index import FTS, BTree, Bitmap, HnswPq, HnswSq, IvfPq, LabelList +from lancedb.index import FTS, BTree, Bitmap, HnswPq, HnswSq, IvfFlat, IvfPq, LabelList from lancedb.remote.db import LOOP import pyarrow as pa @@ -235,10 +235,12 @@ class RemoteTable(Table): config = HnswPq(distance_type=metric) elif index_type == "IVF_HNSW_SQ": config = HnswSq(distance_type=metric) + elif index_type == "IVF_FLAT": + config = IvfFlat(distance_type=metric) else: raise ValueError( f"Unknown vector index type: {index_type}. Valid options are" - " 'IVF_PQ', 'IVF_HNSW_PQ', 'IVF_HNSW_SQ'" + " 'IVF_FLAT', 'IVF_PQ', 'IVF_HNSW_PQ', 'IVF_HNSW_SQ'" ) LOOP.run(self._table.create_index(vector_column_name, config=config))