🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Go

GetCompactionState()

This method compacts segments to improve search efficiency.

func (c *Client) GetCompactionState(ctx context.Context, option GetCompactionStateOption, callOptions ...grpc.CallOption) (entity.CompactionState, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

GetCompactStateOption

callOptions

Optional parameters for calling the methods.

grpc.CallOption

GetCompactStateOption

This is an interface type. The getCompactStateOption struct type implements this interface type.

You can use the NewGetCompactStateOption() function to get the concrete implementation.

NewGetCompactStateOption()

The signature of this method is as follows:

func NewGetCompactionStateOption(compactionID int64) *getCompactionStateOption

Parameter

Description

Type

compactionID

ID of a compaction task, which is the value that the compact() method returns.

int64

entity.CompactionState

The entity.CompactionState is a private enum type and has the following possible values.

const (
    CompactionStateRunning   CompactionState = CompactionState(commonpb.CompactionState_Executing)
    CompactionStateCompleted CompactionState = CompactionState(commonpb.CompactionState_Completed)
)

Return

entity.CompactionState

Example

import (
        "context"
        "github.com/milvus-io/milvus/client/v2/milvusclient"
)

state, err := cli.GetCompactionState(ctx, milvusclient.NewGetCompactionStateOption(compactID))
if err != nil {
    // handle err
}
fmt.Println(state)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?