メインコンテンツまでスキップ

コレクションを作成します (V1)

ノート

クラスターにコレクションを作成します。

POST/v1/vector/collections/create
接続エンドポイント

https://${CLUSTER_ENDPOINT}

📘ノート
  • ${CLUSTER_ENDPOINT} を、あなたのZilliz Cloudクラスターのエンドポイントに置き換える必要があります。
  • エンドポイントを取得するには、Describe Cluster APIを使用してレスポンスから値を抽出してください。
shell
export CLUSTER_ENDPOINT=""
パラメータ
Authorizationstringheader必要

認証トークンは、適切な権限を持つ API key、または username:password のようにコロンで連結したユーザー名とパスワードの組み合わせである必要があります。

値の例: Bearer {{TOKEN}}
リクエスト・ボディ
dbNamestring

データベースの名前。このパラメーターは専用クラスターにのみ適用されます。

collectionNamestring必要

作成するコレクションの名前。

dimensioninteger必要

コレクションのベクトルフィールドの次元数。

値の範囲: ≥ 1≤ 32768
metricTypestring

コレクションで使用される距離メトリック。

primaryFieldstring

主キーのフィールド名。

vectorFieldstring

ベクトルフィールド。

descriptionstring

コレクションの説明

Option 1bash
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/collections/create" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"collectionName": "medium_articles",
"dimension": 256,
"metricType": "COSINE",
"primaryField": "id",
"vectorField": "vector"
}'
レスポンス

空のオブジェクトを返します。

codeinteger

レスポンスコード。

dataobject

空のオブジェクトであるレスポンスペイロード。

エラーメッセージを返します。

codeinteger

レスポンスコード。

messagestring

エラーメッセージ。

Successjson
{
"code": 200,
"data": {}
}