AlterCollectionFunction()

Alters a function attached to a collection schema.

pub async fn alter_collection_function(&self, request: AlterCollectionFunctionRequest) -> Result<()>

This request type is deprecated: Milvus 3.0 and later do not support altering a function separately. Use AddFunctionFieldRequest and DropFunctionFieldRequest instead.

Request Syntax

let request = AlterCollectionFunctionRequest::builder()
    .collection_name("books")
    .function(
        Function::new()
            .name("bm25_title")
            .function_type(FunctionType::Bm25)
            .add_output_field("title_vector"),
    )
    .build()?;

REQUEST FIELDS:

  • database_name: Option<String>

    Name of the target database; uses the default database when empty.

  • collection_name: String

    Name of the collection that owns the function. Required.

  • function: Option<Function>

    The updated function definition. Required.

RETURN TYPE:

Result<()>

RETURNS:

Returns an empty result indicating success. Returns Error on failure.

Example

let request = AlterCollectionFunctionRequest::builder()
    .collection_name("books")
    .function(
        Function::new()
            .name("bm25_title")
            .function_type(FunctionType::Bm25)
            .add_output_field("title_vector"),
    )
    .build()?;
client.alter_collection_function(request).await?;

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?