This method loads partition(s) of the specified collection to memory (for search or query).
client.LoadPartitions(ctx, collName, partNames, async)
Parameter | Description | Type |
---|---|---|
ctx | Context to control API invocation process | context.Context |
collName | Name of the collection to load partition from | String |
partNames | List of names of the partitions to load | Slice of string |
async | Switch value to enable the async load. Note: the deadline of context is not applied in sync load. | Boolean |
No return.
err
: error in the loading process (if any). Possible errors are listed below:
ErrClientNotReady
, error that the client is not connected.
ErrCollectionNotExists
, error that the collection with the specified name does not exist.
error that API invocation failed.
err := milvusClient.LoadPartitions(
context.Background(),
"book",
[]string{"novel"},
false
)
if err != nil {
log.Fatal("failed to load partitions:", err.Error())
}