Python
from actian_vectorai_client import VectorAIClient, OptimizersConfigDiff
with VectorAIClient("localhost:6574") as client:
# Update optimizer configuration
client.collections.update(
"my_collection",
optimizers_config=OptimizersConfigDiff(
indexing_threshold=50_000
)
)
print("✓ Collection updated")
import { VectorAIClient } from '@actian/vectorai-client';
const client = new VectorAIClient('localhost:6574');
await client.collections.update('my_collection', {
hnswConfig: { m: 32, efConstruct: 200 },
});
console.log('Updated HNSW config');
client.close();
curl -X PATCH "http://localhost:6573/collections/my_collection" \
-H "Content-Type: application/json" \
-H 'Authorization: Bearer <admin-jwt-or-access-token>' \
-d '{
"optimizers_config": {
"indexing_threshold": 50000
}
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6573",
CURLOPT_URL => "http://localhost:6573/collections/{collection_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'optimizers_config' => [
'indexing_threshold' => 50000
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:6573/collections/{collection_name}"
payload := strings.NewReader("{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:6573/collections/{collection_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6573/collections/{collection_name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}"
response = http.request(request)
puts response.read_body{
"usage": {
"hardware": null
},
"time": 0.000588548,
"status": "ok",
"result": true
}Collections
Update collection
Update parameters of an existing collection, such as optimizer configuration and HNSW search settings. Vector dimension and distance metric cannot be changed after creation.
PATCH
/
collections
/
{collection_name}
Python
from actian_vectorai_client import VectorAIClient, OptimizersConfigDiff
with VectorAIClient("localhost:6574") as client:
# Update optimizer configuration
client.collections.update(
"my_collection",
optimizers_config=OptimizersConfigDiff(
indexing_threshold=50_000
)
)
print("✓ Collection updated")
import { VectorAIClient } from '@actian/vectorai-client';
const client = new VectorAIClient('localhost:6574');
await client.collections.update('my_collection', {
hnswConfig: { m: 32, efConstruct: 200 },
});
console.log('Updated HNSW config');
client.close();
curl -X PATCH "http://localhost:6573/collections/my_collection" \
-H "Content-Type: application/json" \
-H 'Authorization: Bearer <admin-jwt-or-access-token>' \
-d '{
"optimizers_config": {
"indexing_threshold": 50000
}
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6573",
CURLOPT_URL => "http://localhost:6573/collections/{collection_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'optimizers_config' => [
'indexing_threshold' => 50000
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:6573/collections/{collection_name}"
payload := strings.NewReader("{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:6573/collections/{collection_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6573/collections/{collection_name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"optimizers_config\": {\n \"indexing_threshold\": 50000\n }\n}"
response = http.request(request)
puts response.read_body{
"usage": {
"hardware": null
},
"time": 0.000588548,
"status": "ok",
"result": true
}Authorizations
Admin JWT or access token for authenticating requests to VectorAI DB.
Path Parameters
The name of the collection to update.
Example:
"my_collection"
Query Parameters
The maximum time to wait for the operation to complete, in seconds.
Example:
30
Body
application/json