DropFunctionField
This operation removes a function from an existing collection by function name.
func (c *Client) DropFunctionField(ctx context.Context, opt DropFunctionFieldOption, callOpts ...grpc.CallOption) error
Request Syntax
Creates the request for DropFunctionField().
option := milvusclient.NewDropFunctionFieldOption(collectionName, functionName)
err := client.DropFunctionField(ctx, option)
PARAMETERS:
-
collectionName (string) -
[REQUIRED]
The name of the target collection.
-
functionName (string) -
[REQUIRED]
The functionName for DropFunctionField.
BUILDER METHODS:
-
NewDropFunctionFieldOption(collectionName string, functionName string)Creates options to drop a function by its name.
collectionNamespecifies the collection, andfunctionNamespecifies the function to remove.
RETURN TYPE:
error
RETURNS:
Returns nil after the function is dropped. Returns an error when client-side validation or the RPC fails.
ERROR HANDLING:
-
error
The operation fails. Validation, request construction, or the RPC fails. Check
err != nilfor failure details.
Example
Demonstrates DropFunctionField() usage.
import (
"context"
"github.com/milvus-io/milvus/client/v3/milvusclient"
)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{Address: "YOUR_CLUSTER_ENDPOINT"})
if err != nil {
// handle error
}
defer cli.Close(ctx)
err = cli.DropFunctionField(ctx, milvusclient.NewDropFunctionFieldOption("books", "bm25_fn"))
if err != nil {
// handle error
}