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

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

この操作は、既存のコレクションに StructArray フィールドを追加します。

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

https://${CLUSTER_ENDPOINT}

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

認証トークンは、適切な権限を持つ API key または username:password のようにコロンで連結した username と password の組み合わせである必要があります。project endpoint を使用している場合は、十分な権限を持つ有効な API key のみ使用できます。

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

データベースの名前。

collectionNamestring必要

コレクションの名前。

schemaobject必要

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

fieldNamestring必要

StructArray フィールドの名前。

descriptionstring

StructArray フィールドの説明。

dataTypestring必要

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

elementDataTypestring

dataType が Array の場合の要素タイプ。

fieldsarray必要

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

[]fieldsobject必要

struct array 内のサブフィールド定義です。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

エラーメッセージ。