Creates a document 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:CreateDocumentCollection | create | *Collection acs:gpdb:{#regionId}:{#accountId}:collection/{#DBInstanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The instance ID. Note
You can call the DescribeDBInstances API to view details of all AnalyticDB for PostgreSQL instances in the target region, including the instance ID.
| gp-xxxxxxxxx |
ManagerAccount | string | Yes | The name of the manager account that has the rds_superuser permission. 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 management account. | testpassword |
Namespace | string | No | The name of the namespace. Default value: public. 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 document collection that you want to create. Note
The name must comply with PostgreSQL object naming restrictions.
| document |
RegionId | string | Yes | The region ID of the instance. | cn-hangzhou |
EmbeddingModel | string | No | The vectorization algorithm. Note
Supported algorithms:
| text-embedding-v1 |
FullTextRetrievalFields | string | No | The fields used for full-text search. Separate multiple fields with commas (,). These fields must be keys defined in Metadata. | title,page |
Metadata | string | No | 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 The fields id, vector, doc_name, content, loader_metadata, source, and to_tsvector are reserved and should not be used. | {"title":"text","page":"int"} |
Parser | string | No | The analyzer that is used for full-text search. Default value: zh_cn. | zh_cn |
Metrics | string | No | The method that is used to create vector indexes. Valid values:
| 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.
| 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:
| 1 |
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 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "Successful",
"Status": "successs"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-09 | The request parameters of the API has changed | View Change Details |