ReleasePartitions
This operation releases one or more loaded partitions from memory.
func (c *Client) ReleasePartitions(ctx context.Context, option ReleasePartitionsOption, callOptions ...grpc.CallOption) error
Request Syntax
Creates the request for ReleasePartitions().
option := milvusclient.NewReleasePartitionsOptions(collectionName, partitionNames...)
err := client.ReleasePartitions(ctx, option)
PARAMETERS:
-
collectionName (string) -
[REQUIRED]
The name of the target collection.
-
partitionNames (...string) -
[REQUIRED]
The name(s) of the partition(s).
BUILDER METHODS:
-
NewReleasePartitionsOptions(collectionName string, partitionNames ...string)Creates options to release partitions.
collectionNamespecifies the collection, andpartitionNameslists the partitions to release.
RETURN TYPE:
error
RETURNS:
Returns nil after the partitions are released. Returns an error if the operation fails.
ERROR HANDLING:
-
error
The operation fails. Request construction or the RPC fails. Check
err != nilfor failure details.
Example
Demonstrates ReleasePartitions() 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.ReleasePartitions(ctx, milvusclient.NewReleasePartitionsOptions("books", "chunk_1", "chunk_2"))
if err != nil {
// handle error
}