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:
Parameters | Description | Required |
---|---|---|
field_name (str) | Name of field to index | Yes |
index_name (str) | Index name | Yes |
index_type (IndexType) | Index type, must be one of types stored in IndexType(Enum) class | Yes |
metric_type (MetricType) | Metric type, must be one of types stored in MetricType(Enum) class | Yes |
**kwargs | Other alternative parameters, depends on index and metric type | No |