< Docs
  • Java


MilvusClient interface. This method releases partitions' data from memory.

R<RpcStatus> releasePartitions(ReleasePartitionsParam requestParam);


Use the ReleasePartitionsParam.Builder to construct a ReleasePartitionsParam object.

import io.milvus.param.ReleasePartitionsParam;
ReleasePartitionsParam.Builder builder = ReleasePartitionsParam.newBuilder();

Methods of ReleasePartitionsParam.Builder:

Method Description Parameters
withCollectionName(String collectionName) Set the collection name. Collection name cannot be empty or null. collectionName: The target collection name.
withPartitionNames(List\ partitionNames) Set the partition names list. Partition names list cannot be null or empty. partitionNames: The name list of partitions to be released.
addPartitionName(String partitionName) Add a partition by name. Partition name cannot be empty or null. partitionName: A target partition name.
build() Construct a ReleasePartitionsParam object. N/A

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R<RpcStatus> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknown and error message of the exception.

  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.*;

ReleasePartitionsParam param = ReleasePartitionsParam.newBuilder()
R<Boolean> response = client.releasePartitions(param);
if (response.getStatus() != R.Status.Success.getCode()) {


Was this page helpful?