DropIndexProperties
This operation removes one or more properties from an existing index.
func (c *Client) DropIndexProperties(ctx context.Context, opt DropIndexPropertiesOption, callOptions ...grpc.CallOption) error
Request Syntax
Creates the request for DropIndexProperties().
option := milvusclient.NewDropIndexPropertiesOption(collectionName, indexName, keys...)
err := client.DropIndexProperties(ctx, option)
PARAMETERS:
-
collectionName (string) -
[REQUIRED]
The name of the target collection.
-
indexName (string) -
[REQUIRED]
The name of the index.
-
keys (...string) -
[REQUIRED]
The keys for DropIndexProperties.
BUILDER METHODS:
-
NewDropIndexPropertiesOption(collectionName string, indexName string, keys ...string)Creates options to drop index properties.
collectionNamespecifies the collection,indexNamespecifies the index, andkeyslists the property keys to remove.
RETURN TYPE:
error
RETURNS:
Returns nil after the index properties are dropped. Returns an error if the operation fails.
ERROR HANDLING:
-
error
The operation fails. Request construction or the RPC fails. Check
err != nilfor failure details.
Example
Demonstrates DropIndexProperties() usage.
import (
"context"
"github.com/milvus-io/milvus/client/v3/milvusclient"
)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{Address: "YOUR_CLUSTER_ENDPOINT"})
if err != nil {
// handle error
}
defer cli.Close(ctx)
err = cli.DropIndexProperties(ctx, milvusclient.NewDropIndexPropertiesOption("books", "vector_index", "mmap.enabled"))
if err != nil {
// handle error
}