CreateVectorIndex
Creates an index for a vector collection.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
gpdb:CreateVectorIndex |
create |
*Collection
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. Note
You can call the DescribeDBInstances operation to view the details of all AnalyticDB for PostgreSQL instances in a specific region, including the instance ID. |
gp-xxxxxxxxx |
| Collection |
string |
Yes |
The collection name. Note
You can call the ListCollections operation to list all collections. |
document |
| Dimension |
integer |
No |
The vector dimension. Note
|
1024 |
| ManagerAccount |
string |
Yes |
The name of the management account that has Note
You can create an account on the **account management** page in the console or by calling the CreateAccount operation. |
testaccount |
| ManagerAccountPassword |
string |
Yes |
The password of the management account. |
testpassword |
| Metrics |
string |
No |
The distance metric used to build the vector index. Valid values:
Note
Sparse vectors support only |
cosine |
| Namespace |
string |
No |
The namespace. The default value is Note
You can call the ListNamespaces operation to list all namespaces. |
mynamespace |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| PqEnable |
integer |
No |
Specifies whether to enable Product Quantization (PQ) to accelerate indexing. Recommended for collections with over 500,000 vectors. Valid values:
|
1 |
| HnswM |
integer |
No |
The maximum number of neighbors for the Hierarchical Navigable Small World (HNSW) algorithm. The system automatically sets this value based on the vector dimension. You do not typically need to configure this parameter manually. Note
Valid values:
Note
We recommend the following values based on the vector dimension:
|
64 |
| HnswEfConstruction |
integer |
No |
The size of the candidate set for the HNSW algorithm during index construction. The value must be in the range of 4 to 1,000. The default value is 64. Note
This parameter applies only to AnalyticDB for PostgreSQL V7.0 instances, and its value must be greater than or equal to |
128 |
| ExternalStorage |
integer |
No |
Specifies whether to use Valid values:
Important The ExternalStorage parameter is supported only by AnalyticDB for PostgreSQL V6.0. |
0 |
| Type |
string |
No |
The vector type. Valid values:
|
Dense |
| Algorithm |
string |
No |
The vector indexing algorithm. Valid values:
|
hnswflat |
| Nlist |
integer |
No |
The number of lists (partitions) for the Novad algorithm. The value must be in the range of 2 to 1,073,741,824. The default value is 256. |
256 |
| RabitqBits |
integer |
No |
The number of bits for rabitq compression. The valid range is 1 to 8. The default value is 3. |
3 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Message |
string |
The response message. |
Successful |
| Status |
string |
The status of the request. Valid values:
|
success |
Examples
Success response
JSON format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "Successful",
"Status": "success"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.