< Docs
  • Java


MilvusClient interface. This method drops an index of a field for the specified collection.

R<RpcStatus> dropIndex(DropIndexParam requestParam);


Use the DropIndexParam.Builder to construct a DropIndexParam object.

import io.milvus.param.DropIndexParam;
DropIndexParam.Builder builder = DropIndexParam.newBuilder();

Methods of DropIndexParam.Builder:

Method Description Parameters
withCollectionName(collectionName) Set the collection name. Collection name cannot be empty or null. collectionName: The target collection name.
withIndexName(String indexName) The name of index which will be dropped. If no index name is specified, the default index name is empty string which means let the server determine it. indexName: The name of the index.
build() Construct a CreateAliasParam object. N/A

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R<RpcStatus> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknown and error message of the exception.

  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.*;

DropIndexParam param = DropIndexParam.newBuilder()
R<RpcStatus> response = client.dropIndex(param)
if (response.getStatus() != R.Status.Success.getCode()) {