丢弃索引(drop_index)

删除索引

本文介绍如何在 Milvus 中删除索引。

删除索引会不可逆地移除所有对应的索引文件。

Python Java GO Node.js CLI Curl

from pymilvus import Collection
collection = Collection("book")      # Get an existing collection.
collection.drop_index()
 
await milvusClient.dropIndex({
  collection_name: "book",
});
 
err = milvusClient.DropIndex(
  context.Background(),     // ctx
  "book",                   // CollectionName
  "book_intro",             // fieldName
)
if err != nil {
  log.Fatal("fail to drop index:", err.Error())
}
 
milvusClient.dropIndex(
  DropIndexParam.newBuilder()
    .withCollectionName("book")
    .withFieldName("book_intro")
    .build()
);
 
delete index -c book
 
curl -X 'DELETE' 
  'http://localhost:9091/api/v1/index' 
  -H 'accept: application/json' 
  -H 'Content-Type: application/json' 
  -d '{
    "collection_name": "book",
    "field_name": "book_intro"
  }'
 
参数描述
collection_name要从其中删除索引的向量集合名称。
参数描述
ctx控制 API 调用过程的上下文。
CollectionName要删除索引的向量集合名称。
fieldName要删除索引的向量字段名称。
参数描述
CollectionName要删除索引的向量集合名称。
FieldName要删除索引的向量字段名称。
选项描述
-c要从其中删除索引的向量集合名称。
参数描述
collection_name要删除索引的向量集合名称。
field_name要删除索引的向量字段名称。

下一步怎么做