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

Milvus
Zilliz
< Docs
  • Go

ListIndexes()

This method lists all indexes created within the specified collection.

func (c *Client) ListIndexes(ctx context.Context, opt ListIndexOption, callOptions ...grpc.CallOption) ([]string, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

opt

Optional parameters of the methods.

ListIndexOption

callOpts

Optional parameters for calling the methods.

grpc.CallOption

ListIndexOption

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

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

NewListIndexOption()

The signature of this method is as follows:

func NewListIndexOption(collectionName string) *listIndexOption

Parameter

Description

Type

collectionName

Name of the target collection.

string

Return

[]string

Example

indexes, err := cli.ListIndexes(ctx, milvusclient.NewListIndexOption("my_collection").WithFieldName("my_vector"))
if err != nil {
    // handle err
}
fmt.Println(indexes)

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?