All Products
Search
Document Center

AnalyticDB:CreateDocumentCollection

Last Updated:Dec 24, 2024
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Creates a document collection.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
gpdb:CreateDocumentCollectioncreate
*Collection
acs:gpdb:{#regionId}:{#accountId}:collection/{#DBInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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
ManagerAccountstringYes

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
ManagerAccountPasswordstringYes

The password of the management account.

testpassword
NamespacestringNo

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
CollectionstringYes

The name of the document collection that you want to create.

Note The name must comply with PostgreSQL object naming restrictions.
document
RegionIdstringYes

The region ID of the instance.

cn-hangzhou
EmbeddingModelstringNo

The vectorization algorithm.

Note Supported algorithms:
  • text-embedding-v1: the algorithm that produces 1536-dimensional vectors.

  • text-embedding-v2: the algorithm that produces 1536-dimensional vectors.

  • text2vec: the algorithm that produces 1024-dimensional vectors.

  • m3e-base: the algorithm that produces 768-dimensional vectors.

  • m3e-small: the algorithm that produces 512-dimensional vectors.

  • clip-vit-b-32: the image vectorization algorithm that uses the Contrastive Language-Image Pre-Training (CLIP) ViT-B/32 model and produces 512-dimensional vectors.

  • clip-vit-b-16: the image vectorization algorithm that uses the CLIP ViT-B/16 model and produces 512-dimensional vectors.

  • clip-vit-l-14: the image vectorization algorithm that uses the CLIP ViT-L/14 model and produces 768-dimensional vectors.

  • clip-vit-l-14-336px: the image vectorization algorithm that uses the CLIP ViT-L/14@336px model and produces 768-dimensional vectors.

  • clip-rn50: the image vectorization algorithm that uses the CLIP RN50 model and produces 1024-dimensional vectors.

  • clip-rn101: the image vectorization algorithm that uses the CLIP RN101 model and produces 512-dimensional vectors.

  • clip-rn50x4: the image vectorization algorithm that uses the CLIP RN50x4 model and produces 640-dimensional vectors.

  • clip-rn50x16: the image vectorization algorithm that uses the CLIP RN50x16 model and produces 768-dimensional vectors.

  • clip-rn50x64: the image vectorization algorithm that uses the CLIP RN50x64 model and produces 1024-dimensional vectors.

text-embedding-v1
FullTextRetrievalFieldsstringNo

The fields used for full-text search. Separate multiple fields with commas (,). These fields must be keys defined in Metadata.

title,page
MetadatastringNo

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:
  • For information about data types, see: Data Types.
  • The money type is not supported.
  • 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"}
    ParserstringNo

    The analyzer that is used for full-text search. Default value: zh_cn.

    zh_cn
    MetricsstringNo

    The method that is used to create vector indexes.

    Valid values:

    • l2: Euclidean distance.
    • ip: inner product distance.
    • cosine (default): cosine similarity.
    cosine
    HnswMintegerNo

    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
    PqEnableintegerNo

    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: no.
    • 1 (default): yes.
    1
    ExternalStorageintegerNo

    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: uses segmented paging storage to create indexes. This method uses the shared buffer of PostgreSQL for caching and supports the delete and update operations.

    • 1: uses the memory mapping technology to create indexes. This method does not support the delete or update operation.

    0

    Response parameters

    ParameterTypeDescriptionExample
    object
    RequestIdstring

    The request ID.

    ABB39CC3-4488-4857-905D-2E4A051D0521
    Messagestring

    The returned message.

    Successful
    Statusstring

    The status of the operation. Valid values:

    • success
    • fail
    successs

    Examples

    Sample success responses

    JSONformat

    {
      "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 timeSummary of changesOperation
    2024-01-09The request parameters of the API has changedView Change Details