LoadPartitions()
This method loads the data of specific partitions into memory.
func (c *GrpcClient) LoadPartitions(ctx context.Context, collName string, partitionNames []string, async bool) error
Request Parameters
Parameter |
Description |
Type |
---|---|---|
|
Context for the current call to work. |
|
|
Name of a collection |
|
|
Names of the partitions to load. |
|
|
Whether this operation is asynchronous. |
|
Return
Null
Errors
Any error in the execution of the request. Possible errors are as follows:
ErrClientNotReady
: The client is not connected to Milvus.ErrCollectionNotExists
: The specified collection does not exist.Partitions with the specified name do not exist.
The call to this API fails.
Example
// load partitions
errPar := mc.LoadPartitions(context.Background(), collectionName, []string{"_default", "p1"}, true)
if errPar != nil {
log.Fatal("failed to load partition:", errPar.Error())
}