milvus-logo
Star
0
Forks
0
Get Started

LoadPartitions()

This method loads partition(s) of the specified collection to memory (for search or query).

Invocation

client.LoadPartitions(ctx, collName, partNames, async)

Parameters

ParameterDescriptionType
ctxContext to control API invocation processcontext.Context
collNameName of the collection to load partition fromString
partNamesList of names of the partitions to loadSlice of string
asyncSwitch value to enable the async load.
Note: the deadline of context is not applied in sync load.
Boolean

Constraints

  • Error will be returned at the attempt to load partition(s) when the parent collection is already loaded. Future releases will support releasing partitions from a loaded collection, and (if needed) then loading some other partition(s).
  • "Load successfully" will be returned at the attempt to load the collection that is already loaded.
  • Error will be returned at the attempt to load the collection when the child partition(s) is/are already loaded. Future releases will support loading the collection when some of its partitions are already loaded.
  • Loading different partitions in a same collection via separate RPCs is not allowed.

Return

No return.

Errors

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.

Example

err := milvusClient.LoadPartitions(
  context.Background(),
  "book",
  []string{"novel"},
  false
)
if err != nil {
  log.Fatal("failed to load partitions:", err.Error())
}