Skip to main content

dropIndex()

This operation drops an index from a specific collection.

public void dropIndex(DropIndexReq request)

Request Syntax

dropIndex(DropIndexReq.builder()
.collectionName(String collectionName)
.fieldName(String fieldName)
.indexName(String indexName)
.build()
)

BUILDER METHODS:

  • collectionName(String collectionName)

    The name of an existing collection.

  • fieldName(String fieldName)

    The name of the field on which the index is created.

  • indexName(String indexName)

    The name of the index to drop.

RETURNS:

void

EXCEPTIONS:

  • MilvusClientExceptions

    This exception will be raised when any error occurs during this operation.

Example

import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.service.index.request.DropIndexReq;

// 1. Set up a client
ConnectConfig connectConfig = ConnectConfig.builder()
.uri("YOUR_CLUSTER_ENDPOINT")
.token("YOUR_CLUSTER_TOKEN")
.build();

MilvusClientV2 client = new MilvusClientV2(connectConfig);

// 2. Drop index for the field "vector"
DropIndexReq dropIndexReq = DropIndexReq.builder()
.collectionName("test")
.fieldName("vector")
.build();
client.dropIndex(dropIndexReq);