Creates a vector collection.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
gpdb:CreateCollection | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | No | The instance ID. Note
You can call the DescribeDBInstances operation to query the IDs of all AnalyticDB for PostgreSQL instances in a specific region.
| gp-xxxxxxxxx |
ManagerAccount | string | Yes | Name of the management account with rds_superuser permissions. Note
You can create an account through the console -> Account Management, or by using the CreateAccount API.
| testaccount |
ManagerAccountPassword | string | Yes | The password of the manager account. | testpassword |
Namespace | string | No | The name of the namespace. Note
You can call the CreateNamespace operation to create a namespace and call the ListNamespaces operation to query a list of namespaces.
| mynamespace |
Collection | string | Yes | The name of the collection that you want to create. Note
The name must comply with the naming conventions of PostgreSQL objects.
| document |
Dimension | long | No | The number of vector dimensions. Note
If you specify this parameter, an index is created. When you call the UpsertCollectionData operation, make sure that the length of the Rows.Vector parameter is the same as the value of this parameter. If you do not specify this parameter, you can call the CreateVectorIndex operation to create an index.
| 1024 |
FullTextRetrievalFields | string | No | Fields used for full-text search, separated by commas (,). These fields must be keys defined in Metadata. | title,content |
Metadata | string | Yes | The metadata of the vector data, which is a JSON string in the MAP format. The key specifies the field name, and the value specifies the data type. Note
Supported data types:
** Warning Reserved fields such as id, vector, to_tsvector, and source cannot be used. | {"title":"text","content":"text","response":"int"} |
Parser | string | No | The analyzer that is used for full-text search. | zh_cn |
RegionId | string | Yes | The region ID of the instance. | cn-hangzhou |
Metrics | string | No | Method used when building the vector index. Value description:
| cosine |
HnswM | integer | No | The maximum number of neighbors for the Hierarchical Navigable Small World (HNSW) algorithm. Valid values: 1 to 1000. In most cases, this parameter is automatically configured based on the value of the Dimension parameter. You do not need to configure this parameter. Note
We recommend that you configure this parameter based on the value of the Dimension parameter.
*If you set Dimension to a value less than or equal to 384, set the value of HnswM to 16. *If you set Dimension to a value greater than 384 and less than or equal to 768, set the value of HnswM to 32. *If you set Dimension to a value greater than 768 and less than or equal to 1024, set the value of HnswM to 64. *If you set Dimension to a value greater than 1024, set the value of HnswM to 128. | 64 |
PqEnable | integer | No | Specifies whether to enable the product quantization (PQ) feature for index acceleration. We recommend that you enable this feature for more than 500,000 rows of data. Valid values:
| 0 |
ExternalStorage | integer | No | Specifies whether to use the memory mapping technology to create HNSW indexes. Valid values: 0 and 1. Default value: 0. We recommend that you set the value to 1 in scenarios that require upload speed but not data deletion. Note
| 0 |
WorkspaceId | string | No | The ID of the workspace that consists of multiple AnalyticDB for PostgreSQL instances. You must specify one of the WorkspaceId and DBInstanceId parameters. If you specify both parameters, the WorkspaceId parameter takes effect. | gp-ws-***** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "create successfully",
"Status": "success"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-08-04 | The request parameters of the API has changed | View Change Details |
2024-01-09 | The request parameters of the API has changed | View Change Details |
2023-11-07 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-08-08 | The request parameters of the API has changed | View Change Details |