After creating vector index, Hippo will not activate it automatically as when the volume of data stored in Hippo is large, index creation will be resource consuming. Users can activate the index when available. Once activated, Hippo will perform automatic maintenance and update the index synchronously once the corresponding data is added/deleted/updated. This chapter introduces how to activate the vector index.
curl -u shiva:shiva -XPOST 'localhost:8902/hippo/v1/{table}/_activate_embedding_index?database_name={database_name}&pretty' -H 'Content-Type: application/json' -d'{
"index_name" : "ivf_flat_index",
"wait_for_completion" : true,
"timeout" : "2m"
}';
Result:
{
"job_id" : "2c7fcdd7cd23479bb8660a86703e5c2f",
"job_status" : "SHIVA_JOB_SUCCESS",
"embedding_number" : 100,
"task_results" : [
{
"id" : "cecfe25db0b840b899cb5b3806bdcfcc",
"status" : "TASK_SUCCESS",
"server" : "172.29.40.26:27861",
"embedding_number" : 100,
"execute_time" : 0.233
}
]
}
Parameter description:
Parameters | Description | Required |
---|---|---|
table | Table name, such as "book" created in this example | Yes |
database_name | Database where the destination table is located | No, defaults to "default" database |
index_name | Vector index name | Yes |
wait_for_completion | Whether to wait until the job is done | Yes |
timeout | Operation timeout | If "wait_for_completion" is set to true, timeout parameter is required |
When activating vector index, Hippo will scan the data stored to create vector index. As mentioned, when data volume is large, this creation process takes time, thus users can set “wait_for_completion” to false to achieve asynchronous activation. During this process, Hippo will return the activation job ID, which can be used for checking job status. After the activation job is complete, the number of vectors used for index creation will be summarized and the whole job will not have negative impact on write operations.