Create Vector Index

index_created = table.create_index(field_name = "vector", index_name = "vector_index", index_type = IndexType.IVF_FLAT, metric_type = MetricType.L2, nlist=10, )  

Result:

This method returns a Boolean value to represent whether this operation is successful. If the error pops up when creating vector index, “ValueError” exception will be raised.

Parameter description:

ParametersDescriptionRequired
field_name (str)Name of field to indexYes
index_name (str)Index nameYes
index_type (IndexType)Index type, must be one of types stored in IndexType(Enum) classYes
metric_type (MetricType)Metric type, must be one of types stored in MetricType(Enum) classYes
**kwargsOther alternative parameters, depends on index and metric typeNo
Table 73 Create Vector Index (Python API)