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

コレクション内の関数の変更 (V2)

This operation alters an existing function in the schema of a collection.

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

https://${CLUSTER_ENDPOINT}

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

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

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

データベースの名前。

collectionNamestring必要

コレクションの名前。

functionNamestring必要

変更する関数の名前。

functionobject必要

関数スキーマオブジェクト。

namestring必要

作成する関数の名前。

descriptionstring

作成する関数の説明。

typestring必要

作成する関数のタイプ。

inputFieldNamesarray必要

作成する関数の入力フィールド名。

[]inputFieldNamesstring

フィールド名。

outputFieldNamesarray必要

作成する関数の出力フィールド名。

[]outputFieldNamesstring

フィールド名。

paramsobject

現在の関数に固有の構成パラメーター。関数タイプがFunctionType.BM25に設定されている場合、パラメーターは不要です。FunctionType.TEXTEMBEDDINGまたはFunctionType.RERANKの関数に適用可能なパラメーターについては、Embedding 関数およびReranking 関数を参照してください。

bash
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/collections/alter_function" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"collectionName": "my_collection",
"functionName": "bm25_fn",
"function": {
"name": "bm25_fn",
"type": "FunctionType.BM25",
"inputFieldNames": [
"text"
],
"outputFieldNames": [
"sparse"
]
}
}'
レスポンス

なし

codeinteger

レスポンスコード。

dataobject

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

codeinteger

レスポンスコード。

messagestring

エラーメッセージ。

Successjson
{
"code": 0,
"data": {}
}
Ctrl I