feat: support to create more vector index types (#1407)

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
This commit is contained in:
BubbleCal
2024-07-02 21:23:03 +08:00
committed by GitHub
parent 020a437230
commit 12b3c87964
2 changed files with 3 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ class RemoteTable(Table):
num_sub_vectors: Optional[int] = None,
replace: Optional[bool] = None,
accelerator: Optional[str] = None,
index_type="vector",
):
"""Create an index on the table.
Currently, the only parameters that matter are
@@ -166,7 +167,6 @@ class RemoteTable(Table):
"replace is not supported on LanceDB cloud."
"Existing indexes will always be replaced."
)
index_type = "vector"
data = {
"column": vector_column_name,

View File

@@ -1173,11 +1173,12 @@ class LanceTable(Table):
replace: bool = True,
accelerator: Optional[str] = None,
index_cache_size: Optional[int] = None,
index_type="IVF_PQ",
):
"""Create an index on the table."""
self._dataset_mut.create_index(
column=vector_column_name,
index_type="IVF_PQ",
index_type=index_type,
metric=metric,
num_partitions=num_partitions,
num_sub_vectors=num_sub_vectors,