create_vector_index
Generate a vector index on a specified field within a table to enable efficient vector similarity searches in Baidu Vector Database. Supports HNSW, HNSWPQ, HNSWSQ index types and L2, COSINE, IP metrics.
Instructions
Create a vector index on a vector type field in the Mochow instance.
Args:
table_name (str): Name of the table.
index_name (str): Name of the index.
field_name (str): Name of the vector field.
index_type (str): Type of vector index. Supported values are "HNSW", "HNSWPQ", "HNSWSQ".
metric_type (str): Distance metric. Supported values are "L2", "COSINE", "IP".
params (Optional[dict[str, Any]]): Additional vector index parameters.
Returns:
str: A message indicating the success of index creation.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
field_name | Yes | ||
index_name | Yes | ||
index_type | No | HNSW | |
metric_type | No | L2 | |
params | No | ||
table_name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"field_name": {
"title": "Field Name",
"type": "string"
},
"index_name": {
"title": "Index Name",
"type": "string"
},
"index_type": {
"default": "HNSW",
"title": "Index Type",
"type": "string"
},
"metric_type": {
"default": "L2",
"title": "Metric Type",
"type": "string"
},
"params": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Params"
},
"table_name": {
"title": "Table Name",
"type": "string"
}
},
"required": [
"table_name",
"index_name",
"field_name"
],
"title": "create_vector_indexArguments",
"type": "object"
}