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

コレクションの Struct フィールドを追加(V2)

This operation adds a StructArray field to an existing collection.

POST/v2/vectordb/collections/struct_fields/add
接続エンドポイント

https://${CLUSTER_ENDPOINT}

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

認証トークンは、適切な権限を持つ API キー、またはユーザー名とパスワードをコロンで連結したペア(例: username:password)である必要があります。プロジェクトエンドポイントを使用する場合、十分な権限を持つ有効な API キーのみが該当します。

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

データベース名。

collectionNamestring必要

コレクション名。

schemaobject必要

StructArray フィールドのスキーマです。

fieldNamestring必要

StructArray フィールドの名前。

descriptionstring

StructArray フィールドの説明。

dataTypestring必要

StructArray のデータ型です。ArrayOfStruct を使用するか、elementDataType を Struct に設定した Array を使用します。

elementDataTypestring

dataType が Array の場合の要素型です。

fieldsarray必要

StructArray フィールド内のスカラー型またはベクトル型のサブフィールドです。

[]fieldsobject必要

struct 配列内のサブフィールド定義です。dataType は、各 struct フィールドのスカラー型またはベクトル型を指します。

fieldNamestring必要

サブフィールドの名前です。

dataTypestring必要

struct フィールドのスカラー型またはベクトル型です。

elementTypeParamsobject

要素型のパラメーターです。たとえば、VarChar では max_length、ベクトル型では dim を使用します。

typeParamsobject
max_capacityinteger

エンティティごとに許可される struct 要素の最大数です。

値の範囲: ≥ 1≤ 4096
nullableboolean

StructArray フィールドが null 値を許容するかどうか。

bash
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/collections/struct_fields/add" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"dbName": "default",
"collectionName": "documents",
"schema": {
"fieldName": "chunks",
"dataType": "ArrayOfStruct",
"fields": [
{
"fieldName": "text",
"dataType": "Array",
"elementDataType": "VarChar",
"elementTypeParams": {
"max_length": 1024
}
}
],
"typeParams": {
"max_capacity": 100
}
}
}'
レスポンス

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

codeinteger

応答コードです。

dataobject

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

codeinteger

応答コードです。

messagestring

エラーメッセージです。

Ctrl I