Create a scalar(for non-vector cols) or a vector index on a table. Make sure your vector column has enough data before creating an index on it.
create_index(
self,
col_name: Optional[str] = None,
vector_col: Optional[str] = None,
num_partitions: Optional[int] = 256,
num_sub_vectors: Optional[int] = 96,
index_cache_size: Optional[int] = None,
metric: Optional[str] = 'L2',
name: Optional[str] = None
) -> None| Name | Type | Description |
|---|---|---|
vector_col | Optional[str] | Default: NoneProvide if you want to create index on a vector column. |
col_name | Optional[str] | Default: NoneProvide if you want to create index on a non-vector column. |
metric | Optional[str] | Default: 'L2'Provide the metric to use for vector index. Defaults to 'L2' choice of metrics: 'L2', 'dot', 'cosine' |
num_partitions | Optional[int] | Default: 256Number of partitions to use for the index. Defaults to 256. |
num_sub_vectors | Optional[int] | Default: 96Number of sub-vectors to use for the index. Defaults to 96. |
index_cache_size | Optional[int] | Default: NoneSize of the index cache. Defaults to None. |
name | Optional[str] | Default: NoneName of the table to create index on. Defaults to None. |