Skip to main content

Flush()

This method synchronously stores entities from memory to storage and returns when the operations on every segments are complete.

func (c *GrpcClient) Flush(ctx context.Context, collName string, async bool, opts ...FlushOption) error

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

collName

Name of a collection.

string

async

Whether this operation is asynchronous

bool

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 collection with the specified name does not exist.

  • The call to this API fails.

Example

// flush
err := mc.Flush(context.Background(), collectionName, false)
if err != nil {
log.Fatal("failed to flush collection:", err.Error())
}