From 0c3f47892ed785bcf9e966c58b264935ad08360d Mon Sep 17 00:00:00 2001 From: Milvus-doc-bot Date: Wed, 13 Nov 2024 02:11:18 +0000 Subject: [PATCH] Generate en docs --- localization/v2.4.x/site/en/userGuide/manage-collections.json | 2 +- localization/v2.4.x/site/en/userGuide/manage-collections.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/v2.4.x/site/en/userGuide/manage-collections.json b/localization/v2.4.x/site/en/userGuide/manage-collections.json index 59b235892..e718ae83b 100644 --- a/localization/v2.4.x/site/en/userGuide/manage-collections.json +++ b/localization/v2.4.x/site/en/userGuide/manage-collections.json @@ -1 +1 @@ -{"codeList":["from pymilvus import MilvusClient, DataType\n\n# 1. Set up a Milvus client\nclient = MilvusClient(\n uri=\"http://localhost:19530\"\n)\n\n# 2. Create a collection in quick setup mode\nclient.create_collection(\n collection_name=\"quick_setup\",\n dimension=5\n)\n\nres = client.get_load_state(\n collection_name=\"quick_setup\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.client.ConnectConfig;\nimport io.milvus.v2.client.MilvusClientV2;\nimport io.milvus.v2.service.collection.request.GetLoadStateReq;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";\n\n// 1. Connect to Milvus server\nConnectConfig connectConfig = ConnectConfig.builder()\n .uri(CLUSTER_ENDPOINT)\n .build();\n\nMilvusClientV2 client = new MilvusClientV2(connectConfig);\n\n// 2. Create a collection in quick setup mode\nCreateCollectionReq quickSetupReq = CreateCollectionReq.builder()\n .collectionName(\"quick_setup\")\n .dimension(5)\n .build();\n\nclient.createCollection(quickSetupReq);\n\n// Thread.sleep(5000);\n\nGetLoadStateReq quickSetupLoadStateReq = GetLoadStateReq.builder()\n .collectionName(\"quick_setup\")\n .build();\n\nBoolean res = client.getLoadState(quickSetupLoadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","address = \"http://localhost:19530\"\n\n// 1. Set up a Milvus Client\nclient = new MilvusClient({address});\n\n// 2. Create a collection in quick setup mode\nlet res = await client.createCollection({\n collection_name: \"quick_setup\",\n dimension: 5,\n}); \n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"quick_setup\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ export MILVUS_URI=\"localhost:19530\"\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\",\n \"dimension\": 5\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 3. Create a collection in customized setup mode\n\n# 3.1. Create schema\nschema = MilvusClient.create_schema(\n auto_id=False,\n enable_dynamic_field=True,\n)\n\n# 3.2. Add fields to schema\nschema.add_field(field_name=\"my_id\", datatype=DataType.INT64, is_primary=True)\nschema.add_field(field_name=\"my_vector\", datatype=DataType.FLOAT_VECTOR, dim=5)\n","import io.milvus.v2.common.DataType;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\n// 3. Create a collection in customized setup mode\n\n// 3.1 Create schema\nCreateCollectionReq.CollectionSchema schema = client.createSchema();\n\n// 3.2 Add fields to schema\nschema.addField(AddFieldReq.builder()\n .fieldName(\"my_id\")\n .dataType(DataType.Int64)\n .isPrimaryKey(true)\n .autoID(false)\n .build());\n\nschema.addField(AddFieldReq.builder()\n .fieldName(\"my_vector\")\n .dataType(DataType.FloatVector)\n .dimension(5)\n .build());\n","// 3. Create a collection in customized setup mode\n// 3.1 Define fields\nconst fields = [\n {\n name: \"my_id\",\n data_type: DataType.Int64,\n is_primary_key: true,\n auto_id: false\n },\n {\n name: \"my_vector\",\n data_type: DataType.FloatVector,\n dim: 5\n },\n]\n","export fields='[{ \\\n \"fieldName\": \"my_id\", \\\n \"dataType\": \"Int64\", \\\n \"isPrimary\": true \\\n}, \\\n{ \\\n \"fieldName\": \"my_vector\", \\\n \"dataType\": \"FloatVector\", \\\n \"elementTypeParams\": { \\\n \"dim\": 5 \\\n } \\\n}]'\n","# 3.3. Prepare index parameters\nindex_params = client.prepare_index_params()\n\n# 3.4. Add indexes\nindex_params.add_index(\n field_name=\"my_id\",\n index_type=\"STL_SORT\"\n)\n\nindex_params.add_index(\n field_name=\"my_vector\", \n index_type=\"IVF_FLAT\",\n metric_type=\"IP\",\n params={ \"nlist\": 128 }\n)\n","import io.milvus.v2.common.IndexParam;\n\n// 3.3 Prepare index parameters\nIndexParam indexParamForIdField = IndexParam.builder()\n .fieldName(\"my_id\")\n .indexType(IndexParam.IndexType.STL_SORT)\n .build();\n\nIndexParam indexParamForVectorField = IndexParam.builder()\n .fieldName(\"my_vector\")\n .indexType(IndexParam.IndexType.IVF_FLAT)\n .metricType(IndexParam.MetricType.L2)\n .extraParams(Map.of(\"nlist\", 1024))\n .build();\n\nList indexParams = new ArrayList<>();\nindexParams.add(indexParamForIdField);\nindexParams.add(indexParamForVectorField);\n","// 3.2 Prepare index parameters\nconst index_params = [{\n field_name: \"my_id\",\n index_type: \"STL_SORT\"\n},{\n field_name: \"my_vector\",\n index_type: \"IVF_FLAT\",\n metric_type: \"IP\",\n params: { nlist: 1024}\n}]\n","export indexParams='[{ \\\n \"fieldName\": \"my_id\", \\\n \"indexName\": \"my_id\", \\\n \"params\": { \\\n \"index_type\": \"SLT_SORT\" \\\n } \\\n}, { \\\n \"fieldName\": \"my_vector\", \\\n \"metricType\": \"COSINE\", \\\n \"indexName\": \"my_vector\", \\\n \"params\": { \\\n \"index_type\": \"IVF_FLAT\", \\\n \"nlist\": 1024 \\\n } \\\n}]'\n","# 3.5. Create a collection with the index loaded simultaneously\nclient.create_collection(\n collection_name=\"customized_setup_1\",\n schema=schema,\n index_params=index_params\n)\n\ntime.sleep(5)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_1\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.CreateCollectionReq;\nimport io.milvus.v2.service.collection.request.GetLoadStateReq;\n\n// 3.4 Create a collection with schema and index parameters\nCreateCollectionReq customizedSetupReq1 = CreateCollectionReq.builder()\n .collectionName(\"customized_setup_1\")\n .collectionSchema(schema)\n .indexParams(indexParams)\n .build();\n\nclient.createCollection(customizedSetupReq1);\n\n// Thread.sleep(5000);\n\n// 3.5 Get load state of the collection\nGetLoadStateReq customSetupLoadStateReq1 = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nres = client.getLoadState(customSetupLoadStateReq1);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","// 3.3 Create a collection with fields and index parameters\nres = await client.createCollection({\n collection_name: \"customized_setup_1\",\n fields: fields,\n index_params: index_params,\n})\n\nconsole.log(res.error_code) \n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\",\n \"schema\": {\n \"autoId\": false,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"my_id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"my_vector\",\n \"dataType\": \"FloatVector\",\n \"elementTypeParams\": {\n \"dim\": \"5\"\n }\n }\n ]\n },\n \"indexParams\": [\n {\n \"fieldName\": \"my_vector\",\n \"metricType\": \"COSINE\",\n \"indexName\": \"my_vector\",\n \"params\": {\n \"index_type\": \"IVF_FLAT\",\n \"nlist\": \"1024\"\n }\n },\n {\n \"fieldName\": \"my_id\",\n \"indexName\": \"my_id\",\n \"params\": {\n \"index_type\": \"STL_SORT\"\n } \n }\n ]\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 3.6. Create a collection and index it separately\nclient.create_collection(\n collection_name=\"customized_setup_2\",\n schema=schema,\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","// 3.6 Create a collection and index it separately\nCreateCollectionReq customizedSetupReq2 = CreateCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .collectionSchema(schema)\n .build();\n\nclient.createCollection(customizedSetupReq2);\n","// 3.4 Create a collection and index it seperately\nres = await client.createCollection({\n collection_name: \"customized_setup_2\",\n fields: fields,\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"schema\": {\n \"autoId\": false,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"my_id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"my_vector\",\n \"dataType\": \"FloatVector\",\n \"elementTypeParams\": {\n \"dim\": \"5\"\n }\n }\n ]\n \n }\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoaded\"\n# }\n# }\n","# 3.6 Create index\nclient.create_index(\n collection_name=\"customized_setup_2\",\n index_params=index_params\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","CreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"customized_setup_2\")\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n\n// Thread.sleep(1000);\n\n// 3.7 Get load state of the collection\nGetLoadStateReq customSetupLoadStateReq2 = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nres = client.getLoadState(customSetupLoadStateReq2);\n\nSystem.out.println(res);\n\n// Output:\n// false\n","// 3.5 Create index\nres = await client.createIndex({\n collection_name: \"customized_setup_2\",\n field_name: \"my_vector\",\n index_type: \"IVF_FLAT\",\n metric_type: \"IP\",\n params: { nlist: 1024}\n})\n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n//\n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/indexes/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"indexParams\": [\n {\n \"metricType\": \"L2\",\n \"fieldName\": \"my_vector\",\n \"indexName\": \"my_vector\",\n \"indexConfig\": {\n \"index_type\": \"IVF_FLAT\",\n \"nlist\": \"1024\"\n }\n }\n ]\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoaded\"\n# }\n# }\n","# 5. View Collections\nres = client.describe_collection(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"collection_name\": \"customized_setup_2\",\n# \"auto_id\": false,\n# \"num_shards\": 1,\n# \"description\": \"\",\n# \"fields\": [\n# {\n# \"field_id\": 100,\n# \"name\": \"my_id\",\n# \"description\": \"\",\n# \"type\": 5,\n# \"params\": {},\n# \"element_type\": 0,\n# \"is_primary\": true\n# },\n# {\n# \"field_id\": 101,\n# \"name\": \"my_vector\",\n# \"description\": \"\",\n# \"type\": 101,\n# \"params\": {\n# \"dim\": 5\n# },\n# \"element_type\": 0\n# }\n# ],\n# \"aliases\": [],\n# \"collection_id\": 448143479230158446,\n# \"consistency_level\": 2,\n# \"properties\": {},\n# \"num_partitions\": 1,\n# \"enable_dynamic_field\": true\n# }\n\n","import io.milvus.v2.service.collection.request.DescribeCollectionReq;\nimport io.milvus.v2.service.collection.response.DescribeCollectionResp;\n\n// 4. View collections\nDescribeCollectionReq describeCollectionReq = DescribeCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nDescribeCollectionResp describeCollectionRes = client.describeCollection(describeCollectionReq);\n\nSystem.out.println(JSONObject.toJSON(describeCollectionRes));\n\n// Output:\n// {\n// \"createTime\": 449005822816026627,\n// \"collectionSchema\": {\"fieldSchemaList\": [\n// {\n// \"autoID\": false,\n// \"dataType\": \"Int64\",\n// \"name\": \"my_id\",\n// \"description\": \"\",\n// \"isPrimaryKey\": true,\n// \"maxLength\": 65535,\n// \"isPartitionKey\": false\n// },\n// {\n// \"autoID\": false,\n// \"dataType\": \"FloatVector\",\n// \"name\": \"my_vector\",\n// \"description\": \"\",\n// \"isPrimaryKey\": false,\n// \"dimension\": 5,\n// \"maxLength\": 65535,\n// \"isPartitionKey\": false\n// }\n// ]},\n// \"vectorFieldName\": [\"my_vector\"],\n// \"autoID\": false,\n// \"fieldNames\": [\n// \"my_id\",\n// \"my_vector\"\n// ],\n// \"description\": \"\",\n// \"numOfPartitions\": 1,\n// \"primaryFieldName\": \"my_id\",\n// \"enableDynamicField\": true,\n// \"collectionName\": \"customized_setup_2\"\n// }\n","// 5. View Collections\nres = await client.describeCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res)\n\n// Output\n// \n// {\n// virtual_channel_names: [ 'by-dev-rootcoord-dml_13_449007919953017716v0' ],\n// physical_channel_names: [ 'by-dev-rootcoord-dml_13' ],\n// aliases: [],\n// start_positions: [],\n// properties: [],\n// status: {\n// extra_info: {},\n// error_code: 'Success',\n// reason: '',\n// code: 0,\n// retriable: false,\n// detail: ''\n// },\n// schema: {\n// fields: [ [Object], [Object] ],\n// properties: [],\n// name: 'customized_setup_2',\n// description: '',\n// autoID: false,\n// enable_dynamic_field: false\n// },\n// collectionID: '449007919953017716',\n// created_timestamp: '449024569603784707',\n// created_utc_timestamp: '1712892797866',\n// shards_num: 1,\n// consistency_level: 'Bounded',\n// collection_name: 'customized_setup_2',\n// db_name: 'default',\n// num_partitions: '1'\n// }\n// \n","curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/describe\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"dbName\": \"default\",\n \"collectionName\": \"test_collection\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"aliases\": [],\n# \"autoId\": false,\n# \"collectionID\": 448707763883002014,\n# \"collectionName\": \"test_collection\",\n# \"consistencyLevel\": \"Bounded\",\n# \"description\": \"\",\n# \"enableDynamicField\": true,\n# \"fields\": [\n# {\n# \"autoId\": false,\n# \"description\": \"\",\n# \"id\": 100,\n# \"name\": \"id\",\n# \"partitionKey\": false,\n# \"primaryKey\": true,\n# \"type\": \"Int64\"\n# },\n# {\n# \"autoId\": false,\n# \"description\": \"\",\n# \"id\": 101,\n# \"name\": \"vector\",\n# \"params\": [\n# {\n# \"key\": \"dim\",\n# \"value\": \"5\"\n# }\n# ],\n# \"partitionKey\": false,\n# \"primaryKey\": false,\n# \"type\": \"FloatVector\"\n# }\n# ],\n# \"indexes\": [\n# {\n# \"fieldName\": \"vector\",\n# \"indexName\": \"vector\",\n# \"metricType\": \"COSINE\"\n# }\n# ],\n# \"load\": \"LoadStateLoaded\",\n# \"partitionsNum\": 1,\n# \"properties\": [],\n# \"shardsNum\": 1\n# }\n# }\n","# 6. List all collection names\nres = client.list_collections()\n\nprint(res)\n\n# Output\n#\n# [\n# \"customized_setup_2\",\n# \"quick_setup\",\n# \"customized_setup_1\"\n# ]\n","import io.milvus.v2.service.collection.response.ListCollectionsResp;\n\n// 5. List all collection names\nListCollectionsResp listCollectionsRes = client.listCollections();\n\nSystem.out.println(listCollectionsRes.getCollectionNames());\n\n// Output:\n// [\n// \"customized_setup_2\",\n// \"quick_setup\",\n// \"customized_setup_1\"\n// ]\n","// 5. List all collection names\nListCollectionsResp listCollectionsRes = client.listCollections();\n\nSystem.out.println(listCollectionsRes.getCollectionNames());\n\n// Output:\n// [\n// \"customized_setup_1\",\n// \"quick_setup\",\n// \"customized_setup_2\"\n// ]\n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"dbName\": \"default\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"quick_setup\",\n# \"customized_setup_1\",\n# \"customized_setup_2\"\n# ]\n# }\n","# 7. Load the collection\nclient.load_collection(\n collection_name=\"customized_setup_2\",\n replica_number=1 # Number of replicas to create on query nodes. Max value is 1 for Milvus Standalone, and no greater than `queryNode.replicas` for Milvus Cluster.\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.LoadCollectionReq;\n\n// 6. Load the collection\nLoadCollectionReq loadCollectionReq = LoadCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.loadCollection(loadCollectionReq);\n\n// Thread.sleep(5000);\n\n// 7. Get load state of the collection\nGetLoadStateReq loadStateReq = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nres = client.getLoadState(loadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","// 7. Load the collection\nres = await client.loadCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nawait sleep(3000)\n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/load\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 7. Load the collection\nclient.load_collection(\n collection_name=\"customized_setup_2\",\n load_fields=[\"my_id\", \"my_vector\"] # Load only the specified fields\n skip_load_dynamic_field=True # Skip loading the dynamic field\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","# 8. Release the collection\nclient.release_collection(\n collection_name=\"customized_setup_2\"\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.ReleaseCollectionReq;\n\n// 8. Release the collection\nReleaseCollectionReq releaseCollectionReq = ReleaseCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.releaseCollection(releaseCollectionReq);\n\n// Thread.sleep(1000);\n\nres = client.getLoadState(loadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// false\n","// 8. Release the collection\nres = await client.releaseCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/release\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoad\"\n# }\n# }\n","# 9.1. Create aliases\nclient.create_alias(\n collection_name=\"customized_setup_2\",\n alias=\"bob\"\n)\n\nclient.create_alias(\n collection_name=\"customized_setup_2\",\n alias=\"alice\"\n)\n","import io.milvus.v2.service.utility.request.CreateAliasReq;\n\n// 9. Manage aliases\n\n// 9.1 Create alias\nCreateAliasReq createAliasReq = CreateAliasReq.builder()\n .collectionName(\"customized_setup_2\")\n .alias(\"bob\")\n .build();\n\nclient.createAlias(createAliasReq);\n\ncreateAliasReq = CreateAliasReq.builder()\n .collectionName(\"customized_setup_2\")\n .alias(\"alice\")\n .build();\n\nclient.createAlias(createAliasReq);\n","// 9. Manage aliases\n// 9.1 Create aliases\nres = await client.createAlias({\n collection_name: \"customized_setup_2\",\n alias: \"bob\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.createAlias({\n collection_name: \"customized_setup_2\",\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"aliasName\": \"bob\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"aliasName\": \"alice\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n","# 9.2. List aliases\nres = client.list_aliases(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"bob\",\n# \"alice\"\n# ],\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.ListAliasesReq;\nimport io.milvus.v2.service.utility.response.ListAliasResp;\n\n// 9.2 List alises\nListAliasesReq listAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nListAliasResp listAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\n// \"bob\",\n// \"alice\"\n// ]\n","// 9.2 List aliases\nres = await client.listAliases({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'bob', 'alice' ]\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"bob\",\n# \"alice\"\n# ]\n# }\n","# 9.3. Describe aliases\nres = client.describe_alias(\n alias=\"bob\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"alias\": \"bob\",\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.DescribeAliasReq;\nimport io.milvus.v2.service.utility.response.DescribeAliasResp;\n\n// 9.3 Describe alias\nDescribeAliasReq describeAliasReq = DescribeAliasReq.builder()\n .alias(\"bob\")\n .build();\n\nDescribeAliasResp describeAliasRes = client.describeAlias(describeAliasReq);\n\nSystem.out.println(JSONObject.toJSON(describeAliasRes));\n\n// Output:\n// {\n// \"alias\": \"bob\",\n// \"collectionName\": \"customized_setup_2\"\n// }\n","// 9.3 Describe aliases\nres = await client.describeAlias({\n collection_name: \"customized_setup_2\",\n alias: \"bob\"\n})\n\nconsole.log(res)\n\n// Output\n// \n// {\n// status: {\n// extra_info: {},\n// error_code: 'Success',\n// reason: '',\n// code: 0,\n// retriable: false,\n// detail: ''\n// },\n// db_name: 'default',\n// alias: 'bob',\n// collection: 'customized_setup_2'\n// }\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/describe\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"bob\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"aliasName\": \"bob\",\n# \"collectionName\": \"quick_setup\",\n# \"dbName\": \"default\"\n# }\n# }\n","# 9.4 Reassign aliases to other collections\nclient.alter_alias(\n collection_name=\"customized_setup_1\",\n alias=\"alice\"\n)\n\nres = client.list_aliases(\n collection_name=\"customized_setup_1\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"alice\"\n# ],\n# \"collection_name\": \"customized_setup_1\",\n# \"db_name\": \"default\"\n# }\n\nres = client.list_aliases(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"bob\"\n# ],\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.AlterAliasReq;\n\n// 9.4 Reassign alias to other collections\nAlterAliasReq alterAliasReq = AlterAliasReq.builder()\n .collectionName(\"customized_setup_1\")\n .alias(\"alice\")\n .build();\n\nclient.alterAlias(alterAliasReq);\n\nlistAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nlistAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\"alice\"]\n\nlistAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nlistAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\"bob\"]\n","// 9.4 Reassign aliases to other collections\nres = await client.alterAlias({\n collection_name: \"customized_setup_1\",\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.listAliases({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'alice' ]\n// \n\nres = await client.listAliases({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'bob' ]\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/alter\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\",\n \"aliasName\": \"alice\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"alice\"\n# ]\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"bob\"\n# ]\n# }\n","# 9.5 Drop aliases\nclient.drop_alias(\n alias=\"bob\"\n)\n\nclient.drop_alias(\n alias=\"alice\"\n)\n","import io.milvus.v2.service.utility.request.DropAliasReq;\n\n// 9.5 Drop alias\nDropAliasReq dropAliasReq = DropAliasReq.builder()\n .alias(\"bob\")\n .build();\n\nclient.dropAlias(dropAliasReq);\n\ndropAliasReq = DropAliasReq.builder()\n .alias(\"alice\")\n .build();\n\nclient.dropAlias(dropAliasReq);\n","// 9.5 Drop aliases\nres = await client.dropAlias({\n alias: \"bob\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropAlias({\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"bob\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"alice\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n","from pymilvus import Collection, connections\n\n# Connect to Milvus server\nconnections.connect(host=\"localhost\", port=\"19530\") # Change to your Milvus server IP and port\n\n# Get existing collection\ncollection = Collection(\"quick_setup\")\n\n# Set the TTL for the data in the collection\ncollection.set_properties(\n properties={\n \"collection.ttl.seconds\": 60\n }\n)\n","from pymilvus import Collection, connections\n\n# Connect to Milvus server\nconnections.connect(host=\"localhost\", port=\"19530\") # Change to your Milvus server IP and port\n\n# Get existing collection\ncollection = Collection(\"quick_setup\")\n\n# Before setting memory mapping property, we need to release the collection first.\ncollection.release()\n\n# Set memory mapping property to True or Flase\ncollection.set_properties(\n properties={\n \"mmap.enabled\": True\n }\n)\n","# 10. Drop the collections\nclient.drop_collection(\n collection_name=\"quick_setup\"\n)\n\nclient.drop_collection(\n collection_name=\"customized_setup_1\"\n)\n\nclient.drop_collection(\n collection_name=\"customized_setup_2\"\n)\n","import io.milvus.v2.service.collection.request.DropCollectionReq;\n\n// 10. Drop collections\n\nDropCollectionReq dropQuickSetupParam = DropCollectionReq.builder()\n .collectionName(\"quick_setup\")\n .build();\n\nclient.dropCollection(dropQuickSetupParam);\n\nDropCollectionReq dropCustomizedSetupParam = DropCollectionReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nclient.dropCollection(dropCustomizedSetupParam);\n\ndropCustomizedSetupParam = DropCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.dropCollection(dropCustomizedSetupParam);\n","// 10. Drop the collection\nres = await client.dropCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropCollection({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropCollection({\n collection_name: \"quick_setup\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n"],"headingContent":"Manage Collections","anchorList":[{"label":"Manage Collections","href":"Manage-Collections","type":1,"isActive":false},{"label":"Before you start","href":"Before-you-start","type":2,"isActive":false},{"label":"Overview","href":"Overview","type":2,"isActive":false},{"label":"Create Collection","href":"Create-Collection","type":2,"isActive":false},{"label":"View Collections","href":"View-Collections","type":2,"isActive":false},{"label":"Load & Release Collection","href":"Load--Release-Collection","type":2,"isActive":false},{"label":"Set up aliases","href":"Set-up-aliases","type":2,"isActive":false},{"label":"Set Properties","href":"Set-Properties","type":2,"isActive":false},{"label":"Drop a Collection","href":"Drop-a-Collection","type":2,"isActive":false}]} \ No newline at end of file +{"codeList":["from pymilvus import MilvusClient, DataType\n\n# 1. Set up a Milvus client\nclient = MilvusClient(\n uri=\"http://localhost:19530\"\n)\n\n# 2. Create a collection in quick setup mode\nclient.create_collection(\n collection_name=\"quick_setup\",\n dimension=5\n)\n\nres = client.get_load_state(\n collection_name=\"quick_setup\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.client.ConnectConfig;\nimport io.milvus.v2.client.MilvusClientV2;\nimport io.milvus.v2.service.collection.request.GetLoadStateReq;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";\n\n// 1. Connect to Milvus server\nConnectConfig connectConfig = ConnectConfig.builder()\n .uri(CLUSTER_ENDPOINT)\n .build();\n\nMilvusClientV2 client = new MilvusClientV2(connectConfig);\n\n// 2. Create a collection in quick setup mode\nCreateCollectionReq quickSetupReq = CreateCollectionReq.builder()\n .collectionName(\"quick_setup\")\n .dimension(5)\n .build();\n\nclient.createCollection(quickSetupReq);\n\n// Thread.sleep(5000);\n\nGetLoadStateReq quickSetupLoadStateReq = GetLoadStateReq.builder()\n .collectionName(\"quick_setup\")\n .build();\n\nBoolean res = client.getLoadState(quickSetupLoadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","address = \"http://localhost:19530\"\n\n// 1. Set up a Milvus Client\nclient = new MilvusClient({address});\n\n// 2. Create a collection in quick setup mode\nlet res = await client.createCollection({\n collection_name: \"quick_setup\",\n dimension: 5,\n}); \n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"quick_setup\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ export MILVUS_URI=\"localhost:19530\"\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\",\n \"dimension\": 5\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 3. Create a collection in customized setup mode\n\n# 3.1. Create schema\nschema = MilvusClient.create_schema(\n auto_id=False,\n enable_dynamic_field=True,\n)\n\n# 3.2. Add fields to schema\nschema.add_field(field_name=\"my_id\", datatype=DataType.INT64, is_primary=True)\nschema.add_field(field_name=\"my_vector\", datatype=DataType.FLOAT_VECTOR, dim=5)\n","import io.milvus.v2.common.DataType;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\n// 3. Create a collection in customized setup mode\n\n// 3.1 Create schema\nCreateCollectionReq.CollectionSchema schema = client.createSchema();\n\n// 3.2 Add fields to schema\nschema.addField(AddFieldReq.builder()\n .fieldName(\"my_id\")\n .dataType(DataType.Int64)\n .isPrimaryKey(true)\n .autoID(false)\n .build());\n\nschema.addField(AddFieldReq.builder()\n .fieldName(\"my_vector\")\n .dataType(DataType.FloatVector)\n .dimension(5)\n .build());\n","// 3. Create a collection in customized setup mode\n// 3.1 Define fields\nconst fields = [\n {\n name: \"my_id\",\n data_type: DataType.Int64,\n is_primary_key: true,\n auto_id: false\n },\n {\n name: \"my_vector\",\n data_type: DataType.FloatVector,\n dim: 5\n },\n]\n","export fields='[{ \\\n \"fieldName\": \"my_id\", \\\n \"dataType\": \"Int64\", \\\n \"isPrimary\": true \\\n}, \\\n{ \\\n \"fieldName\": \"my_vector\", \\\n \"dataType\": \"FloatVector\", \\\n \"elementTypeParams\": { \\\n \"dim\": 5 \\\n } \\\n}]'\n","# 3.3. Prepare index parameters\nindex_params = client.prepare_index_params()\n\n# 3.4. Add indexes\nindex_params.add_index(\n field_name=\"my_id\",\n index_type=\"STL_SORT\"\n)\n\nindex_params.add_index(\n field_name=\"my_vector\", \n index_type=\"IVF_FLAT\",\n metric_type=\"IP\",\n params={ \"nlist\": 128 }\n)\n","import io.milvus.v2.common.IndexParam;\n\n// 3.3 Prepare index parameters\nIndexParam indexParamForIdField = IndexParam.builder()\n .fieldName(\"my_id\")\n .indexType(IndexParam.IndexType.STL_SORT)\n .build();\n\nIndexParam indexParamForVectorField = IndexParam.builder()\n .fieldName(\"my_vector\")\n .indexType(IndexParam.IndexType.IVF_FLAT)\n .metricType(IndexParam.MetricType.L2)\n .extraParams(Map.of(\"nlist\", 1024))\n .build();\n\nList indexParams = new ArrayList<>();\nindexParams.add(indexParamForIdField);\nindexParams.add(indexParamForVectorField);\n","// 3.2 Prepare index parameters\nconst index_params = [{\n field_name: \"my_id\",\n index_type: \"STL_SORT\"\n},{\n field_name: \"my_vector\",\n index_type: \"IVF_FLAT\",\n metric_type: \"IP\",\n params: { nlist: 1024}\n}]\n","export indexParams='[{ \\\n \"fieldName\": \"my_id\", \\\n \"indexName\": \"my_id\", \\\n \"params\": { \\\n \"index_type\": \"SLT_SORT\" \\\n } \\\n}, { \\\n \"fieldName\": \"my_vector\", \\\n \"metricType\": \"COSINE\", \\\n \"indexName\": \"my_vector\", \\\n \"params\": { \\\n \"index_type\": \"IVF_FLAT\", \\\n \"nlist\": 1024 \\\n } \\\n}]'\n","# 3.5. Create a collection with the index loaded simultaneously\nclient.create_collection(\n collection_name=\"customized_setup_1\",\n schema=schema,\n index_params=index_params\n)\n\ntime.sleep(5)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_1\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.CreateCollectionReq;\nimport io.milvus.v2.service.collection.request.GetLoadStateReq;\n\n// 3.4 Create a collection with schema and index parameters\nCreateCollectionReq customizedSetupReq1 = CreateCollectionReq.builder()\n .collectionName(\"customized_setup_1\")\n .collectionSchema(schema)\n .indexParams(indexParams)\n .build();\n\nclient.createCollection(customizedSetupReq1);\n\n// Thread.sleep(5000);\n\n// 3.5 Get load state of the collection\nGetLoadStateReq customSetupLoadStateReq1 = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nres = client.getLoadState(customSetupLoadStateReq1);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","// 3.3 Create a collection with fields and index parameters\nres = await client.createCollection({\n collection_name: \"customized_setup_1\",\n fields: fields,\n index_params: index_params,\n})\n\nconsole.log(res.error_code) \n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\",\n \"schema\": {\n \"autoId\": false,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"my_id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"my_vector\",\n \"dataType\": \"FloatVector\",\n \"elementTypeParams\": {\n \"dim\": \"5\"\n }\n }\n ]\n },\n \"indexParams\": [\n {\n \"fieldName\": \"my_vector\",\n \"metricType\": \"COSINE\",\n \"indexName\": \"my_vector\",\n \"params\": {\n \"index_type\": \"IVF_FLAT\",\n \"nlist\": \"1024\"\n }\n },\n {\n \"fieldName\": \"my_id\",\n \"indexName\": \"my_id\",\n \"params\": {\n \"index_type\": \"STL_SORT\"\n } \n }\n ]\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 3.6. Create a collection and index it separately\nclient.create_collection(\n collection_name=\"customized_setup_2\",\n schema=schema,\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","// 3.6 Create a collection and index it separately\nCreateCollectionReq customizedSetupReq2 = CreateCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .collectionSchema(schema)\n .build();\n\nclient.createCollection(customizedSetupReq2);\n","// 3.4 Create a collection and index it seperately\nres = await client.createCollection({\n collection_name: \"customized_setup_2\",\n fields: fields,\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"schema\": {\n \"autoId\": false,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"my_id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"my_vector\",\n \"dataType\": \"FloatVector\",\n \"elementTypeParams\": {\n \"dim\": \"5\"\n }\n }\n ]\n \n }\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoaded\"\n# }\n# }\n","# 3.6 Create index\nclient.create_index(\n collection_name=\"customized_setup_2\",\n index_params=index_params\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","CreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"customized_setup_2\")\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n\n// Thread.sleep(1000);\n\n// 3.7 Get load state of the collection\nGetLoadStateReq customSetupLoadStateReq2 = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nres = client.getLoadState(customSetupLoadStateReq2);\n\nSystem.out.println(res);\n\n// Output:\n// false\n","// 3.5 Create index\nres = await client.createIndex({\n collection_name: \"customized_setup_2\",\n field_name: \"my_vector\",\n index_type: \"IVF_FLAT\",\n metric_type: \"IP\",\n params: { nlist: 1024}\n})\n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n//\n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/indexes/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"indexParams\": [\n {\n \"metricType\": \"L2\",\n \"fieldName\": \"my_vector\",\n \"indexName\": \"my_vector\",\n \"indexConfig\": {\n \"index_type\": \"IVF_FLAT\",\n \"nlist\": \"1024\"\n }\n }\n ]\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoaded\"\n# }\n# }\n","# 5. View Collections\nres = client.describe_collection(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"collection_name\": \"customized_setup_2\",\n# \"auto_id\": false,\n# \"num_shards\": 1,\n# \"description\": \"\",\n# \"fields\": [\n# {\n# \"field_id\": 100,\n# \"name\": \"my_id\",\n# \"description\": \"\",\n# \"type\": 5,\n# \"params\": {},\n# \"element_type\": 0,\n# \"is_primary\": true\n# },\n# {\n# \"field_id\": 101,\n# \"name\": \"my_vector\",\n# \"description\": \"\",\n# \"type\": 101,\n# \"params\": {\n# \"dim\": 5\n# },\n# \"element_type\": 0\n# }\n# ],\n# \"aliases\": [],\n# \"collection_id\": 448143479230158446,\n# \"consistency_level\": 2,\n# \"properties\": {},\n# \"num_partitions\": 1,\n# \"enable_dynamic_field\": true\n# }\n\n","import io.milvus.v2.service.collection.request.DescribeCollectionReq;\nimport io.milvus.v2.service.collection.response.DescribeCollectionResp;\n\n// 4. View collections\nDescribeCollectionReq describeCollectionReq = DescribeCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nDescribeCollectionResp describeCollectionRes = client.describeCollection(describeCollectionReq);\n\nSystem.out.println(JSONObject.toJSON(describeCollectionRes));\n\n// Output:\n// {\n// \"createTime\": 449005822816026627,\n// \"collectionSchema\": {\"fieldSchemaList\": [\n// {\n// \"autoID\": false,\n// \"dataType\": \"Int64\",\n// \"name\": \"my_id\",\n// \"description\": \"\",\n// \"isPrimaryKey\": true,\n// \"maxLength\": 65535,\n// \"isPartitionKey\": false\n// },\n// {\n// \"autoID\": false,\n// \"dataType\": \"FloatVector\",\n// \"name\": \"my_vector\",\n// \"description\": \"\",\n// \"isPrimaryKey\": false,\n// \"dimension\": 5,\n// \"maxLength\": 65535,\n// \"isPartitionKey\": false\n// }\n// ]},\n// \"vectorFieldName\": [\"my_vector\"],\n// \"autoID\": false,\n// \"fieldNames\": [\n// \"my_id\",\n// \"my_vector\"\n// ],\n// \"description\": \"\",\n// \"numOfPartitions\": 1,\n// \"primaryFieldName\": \"my_id\",\n// \"enableDynamicField\": true,\n// \"collectionName\": \"customized_setup_2\"\n// }\n","// 5. View Collections\nres = await client.describeCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res)\n\n// Output\n// \n// {\n// virtual_channel_names: [ 'by-dev-rootcoord-dml_13_449007919953017716v0' ],\n// physical_channel_names: [ 'by-dev-rootcoord-dml_13' ],\n// aliases: [],\n// start_positions: [],\n// properties: [],\n// status: {\n// extra_info: {},\n// error_code: 'Success',\n// reason: '',\n// code: 0,\n// retriable: false,\n// detail: ''\n// },\n// schema: {\n// fields: [ [Object], [Object] ],\n// properties: [],\n// name: 'customized_setup_2',\n// description: '',\n// autoID: false,\n// enable_dynamic_field: false\n// },\n// collectionID: '449007919953017716',\n// created_timestamp: '449024569603784707',\n// created_utc_timestamp: '1712892797866',\n// shards_num: 1,\n// consistency_level: 'Bounded',\n// collection_name: 'customized_setup_2',\n// db_name: 'default',\n// num_partitions: '1'\n// }\n// \n","curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/describe\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"dbName\": \"default\",\n \"collectionName\": \"test_collection\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"aliases\": [],\n# \"autoId\": false,\n# \"collectionID\": 448707763883002014,\n# \"collectionName\": \"test_collection\",\n# \"consistencyLevel\": \"Bounded\",\n# \"description\": \"\",\n# \"enableDynamicField\": true,\n# \"fields\": [\n# {\n# \"autoId\": false,\n# \"description\": \"\",\n# \"id\": 100,\n# \"name\": \"id\",\n# \"partitionKey\": false,\n# \"primaryKey\": true,\n# \"type\": \"Int64\"\n# },\n# {\n# \"autoId\": false,\n# \"description\": \"\",\n# \"id\": 101,\n# \"name\": \"vector\",\n# \"params\": [\n# {\n# \"key\": \"dim\",\n# \"value\": \"5\"\n# }\n# ],\n# \"partitionKey\": false,\n# \"primaryKey\": false,\n# \"type\": \"FloatVector\"\n# }\n# ],\n# \"indexes\": [\n# {\n# \"fieldName\": \"vector\",\n# \"indexName\": \"vector\",\n# \"metricType\": \"COSINE\"\n# }\n# ],\n# \"load\": \"LoadStateLoaded\",\n# \"partitionsNum\": 1,\n# \"properties\": [],\n# \"shardsNum\": 1\n# }\n# }\n","# 6. List all collection names\nres = client.list_collections()\n\nprint(res)\n\n# Output\n#\n# [\n# \"customized_setup_2\",\n# \"quick_setup\",\n# \"customized_setup_1\"\n# ]\n","import io.milvus.v2.service.collection.response.ListCollectionsResp;\n\n// 5. List all collection names\nListCollectionsResp listCollectionsRes = client.listCollections();\n\nSystem.out.println(listCollectionsRes.getCollectionNames());\n\n// Output:\n// [\n// \"customized_setup_2\",\n// \"quick_setup\",\n// \"customized_setup_1\"\n// ]\n","// 5. List all collection names\nListCollectionsResp listCollectionsRes = client.listCollections();\n\nSystem.out.println(listCollectionsRes.getCollectionNames());\n\n// Output:\n// [\n// \"customized_setup_1\",\n// \"quick_setup\",\n// \"customized_setup_2\"\n// ]\n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"dbName\": \"default\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"quick_setup\",\n# \"customized_setup_1\",\n# \"customized_setup_2\"\n# ]\n# }\n","# 7. Load the collection\nclient.load_collection(\n collection_name=\"customized_setup_2\",\n replica_number=1 # Number of replicas to create on query nodes. Max value is 1 for Milvus Standalone, and no greater than `queryNode.replicas` for Milvus Cluster.\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.LoadCollectionReq;\n\n// 6. Load the collection\nLoadCollectionReq loadCollectionReq = LoadCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.loadCollection(loadCollectionReq);\n\n// Thread.sleep(5000);\n\n// 7. Get load state of the collection\nGetLoadStateReq loadStateReq = GetLoadStateReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nres = client.getLoadState(loadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// true\n","// 7. Load the collection\nres = await client.loadCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nawait sleep(3000)\n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateLoaded\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/load\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadProgress\": 100,\n# \"loadState\": \"LoadStateLoaded\"\n# }\n# }\n","# 7. Load the collection\nclient.load_collection(\n collection_name=\"customized_setup_2\",\n load_fields=[\"my_id\", \"my_vector\"], # Load only the specified fields\n skip_load_dynamic_field=True # Skip loading the dynamic field\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","# 8. Release the collection\nclient.release_collection(\n collection_name=\"customized_setup_2\"\n)\n\nres = client.get_load_state(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"state\": \"\"\n# }\n","import io.milvus.v2.service.collection.request.ReleaseCollectionReq;\n\n// 8. Release the collection\nReleaseCollectionReq releaseCollectionReq = ReleaseCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.releaseCollection(releaseCollectionReq);\n\n// Thread.sleep(1000);\n\nres = client.getLoadState(loadStateReq);\n\nSystem.out.println(res);\n\n// Output:\n// false\n","// 8. Release the collection\nres = await client.releaseCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.getLoadState({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.state)\n\n// Output\n// \n// LoadStateNotLoad\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/release\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {},\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/get_load_state\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"loadState\": \"LoadStateNotLoad\"\n# }\n# }\n","# 9.1. Create aliases\nclient.create_alias(\n collection_name=\"customized_setup_2\",\n alias=\"bob\"\n)\n\nclient.create_alias(\n collection_name=\"customized_setup_2\",\n alias=\"alice\"\n)\n","import io.milvus.v2.service.utility.request.CreateAliasReq;\n\n// 9. Manage aliases\n\n// 9.1 Create alias\nCreateAliasReq createAliasReq = CreateAliasReq.builder()\n .collectionName(\"customized_setup_2\")\n .alias(\"bob\")\n .build();\n\nclient.createAlias(createAliasReq);\n\ncreateAliasReq = CreateAliasReq.builder()\n .collectionName(\"customized_setup_2\")\n .alias(\"alice\")\n .build();\n\nclient.createAlias(createAliasReq);\n","// 9. Manage aliases\n// 9.1 Create aliases\nres = await client.createAlias({\n collection_name: \"customized_setup_2\",\n alias: \"bob\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.createAlias({\n collection_name: \"customized_setup_2\",\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"aliasName\": \"bob\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/create\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\",\n \"aliasName\": \"alice\"\n}'\n\n# Output\n#\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n","# 9.2. List aliases\nres = client.list_aliases(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"bob\",\n# \"alice\"\n# ],\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.ListAliasesReq;\nimport io.milvus.v2.service.utility.response.ListAliasResp;\n\n// 9.2 List alises\nListAliasesReq listAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nListAliasResp listAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\n// \"bob\",\n// \"alice\"\n// ]\n","// 9.2 List aliases\nres = await client.listAliases({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'bob', 'alice' ]\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"bob\",\n# \"alice\"\n# ]\n# }\n","# 9.3. Describe aliases\nres = client.describe_alias(\n alias=\"bob\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"alias\": \"bob\",\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.DescribeAliasReq;\nimport io.milvus.v2.service.utility.response.DescribeAliasResp;\n\n// 9.3 Describe alias\nDescribeAliasReq describeAliasReq = DescribeAliasReq.builder()\n .alias(\"bob\")\n .build();\n\nDescribeAliasResp describeAliasRes = client.describeAlias(describeAliasReq);\n\nSystem.out.println(JSONObject.toJSON(describeAliasRes));\n\n// Output:\n// {\n// \"alias\": \"bob\",\n// \"collectionName\": \"customized_setup_2\"\n// }\n","// 9.3 Describe aliases\nres = await client.describeAlias({\n collection_name: \"customized_setup_2\",\n alias: \"bob\"\n})\n\nconsole.log(res)\n\n// Output\n// \n// {\n// status: {\n// extra_info: {},\n// error_code: 'Success',\n// reason: '',\n// code: 0,\n// retriable: false,\n// detail: ''\n// },\n// db_name: 'default',\n// alias: 'bob',\n// collection: 'customized_setup_2'\n// }\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/describe\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"bob\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {\n# \"aliasName\": \"bob\",\n# \"collectionName\": \"quick_setup\",\n# \"dbName\": \"default\"\n# }\n# }\n","# 9.4 Reassign aliases to other collections\nclient.alter_alias(\n collection_name=\"customized_setup_1\",\n alias=\"alice\"\n)\n\nres = client.list_aliases(\n collection_name=\"customized_setup_1\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"alice\"\n# ],\n# \"collection_name\": \"customized_setup_1\",\n# \"db_name\": \"default\"\n# }\n\nres = client.list_aliases(\n collection_name=\"customized_setup_2\"\n)\n\nprint(res)\n\n# Output\n#\n# {\n# \"aliases\": [\n# \"bob\"\n# ],\n# \"collection_name\": \"customized_setup_2\",\n# \"db_name\": \"default\"\n# }\n","import io.milvus.v2.service.utility.request.AlterAliasReq;\n\n// 9.4 Reassign alias to other collections\nAlterAliasReq alterAliasReq = AlterAliasReq.builder()\n .collectionName(\"customized_setup_1\")\n .alias(\"alice\")\n .build();\n\nclient.alterAlias(alterAliasReq);\n\nlistAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nlistAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\"alice\"]\n\nlistAliasesReq = ListAliasesReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nlistAliasRes = client.listAliases(listAliasesReq);\n\nSystem.out.println(listAliasRes.getAlias());\n\n// Output:\n// [\"bob\"]\n","// 9.4 Reassign aliases to other collections\nres = await client.alterAlias({\n collection_name: \"customized_setup_1\",\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.listAliases({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'alice' ]\n// \n\nres = await client.listAliases({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.aliases)\n\n// Output\n// \n// [ 'bob' ]\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/alter\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\",\n \"aliasName\": \"alice\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"alice\"\n# ]\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/list\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": [\n# \"bob\"\n# ]\n# }\n","# 9.5 Drop aliases\nclient.drop_alias(\n alias=\"bob\"\n)\n\nclient.drop_alias(\n alias=\"alice\"\n)\n","import io.milvus.v2.service.utility.request.DropAliasReq;\n\n// 9.5 Drop alias\nDropAliasReq dropAliasReq = DropAliasReq.builder()\n .alias(\"bob\")\n .build();\n\nclient.dropAlias(dropAliasReq);\n\ndropAliasReq = DropAliasReq.builder()\n .alias(\"alice\")\n .build();\n\nclient.dropAlias(dropAliasReq);\n","// 9.5 Drop aliases\nres = await client.dropAlias({\n alias: \"bob\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropAlias({\n alias: \"alice\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"bob\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/aliases/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"aliasName\": \"alice\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n","from pymilvus import Collection, connections\n\n# Connect to Milvus server\nconnections.connect(host=\"localhost\", port=\"19530\") # Change to your Milvus server IP and port\n\n# Get existing collection\ncollection = Collection(\"quick_setup\")\n\n# Set the TTL for the data in the collection\ncollection.set_properties(\n properties={\n \"collection.ttl.seconds\": 60\n }\n)\n","from pymilvus import Collection, connections\n\n# Connect to Milvus server\nconnections.connect(host=\"localhost\", port=\"19530\") # Change to your Milvus server IP and port\n\n# Get existing collection\ncollection = Collection(\"quick_setup\")\n\n# Before setting memory mapping property, we need to release the collection first.\ncollection.release()\n\n# Set memory mapping property to True or Flase\ncollection.set_properties(\n properties={\n \"mmap.enabled\": True\n }\n)\n","# 10. Drop the collections\nclient.drop_collection(\n collection_name=\"quick_setup\"\n)\n\nclient.drop_collection(\n collection_name=\"customized_setup_1\"\n)\n\nclient.drop_collection(\n collection_name=\"customized_setup_2\"\n)\n","import io.milvus.v2.service.collection.request.DropCollectionReq;\n\n// 10. Drop collections\n\nDropCollectionReq dropQuickSetupParam = DropCollectionReq.builder()\n .collectionName(\"quick_setup\")\n .build();\n\nclient.dropCollection(dropQuickSetupParam);\n\nDropCollectionReq dropCustomizedSetupParam = DropCollectionReq.builder()\n .collectionName(\"customized_setup_1\")\n .build();\n\nclient.dropCollection(dropCustomizedSetupParam);\n\ndropCustomizedSetupParam = DropCollectionReq.builder()\n .collectionName(\"customized_setup_2\")\n .build();\n\nclient.dropCollection(dropCustomizedSetupParam);\n","// 10. Drop the collection\nres = await client.dropCollection({\n collection_name: \"customized_setup_2\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropCollection({\n collection_name: \"customized_setup_1\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n\nres = await client.dropCollection({\n collection_name: \"quick_setup\"\n})\n\nconsole.log(res.error_code)\n\n// Output\n// \n// Success\n// \n","$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"quick_setup\"\n}'\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_1\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n\n\n$ curl -X POST \"http://${MILVUS_URI}/v2/vectordb/collections/drop\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n \"collectionName\": \"customized_setup_2\"\n}'\n\n\n# {\n# \"code\": 0,\n# \"data\": {}\n# }\n"],"headingContent":"Manage Collections","anchorList":[{"label":"Manage Collections","href":"Manage-Collections","type":1,"isActive":false},{"label":"Before you start","href":"Before-you-start","type":2,"isActive":false},{"label":"Overview","href":"Overview","type":2,"isActive":false},{"label":"Create Collection","href":"Create-Collection","type":2,"isActive":false},{"label":"View Collections","href":"View-Collections","type":2,"isActive":false},{"label":"Load & Release Collection","href":"Load--Release-Collection","type":2,"isActive":false},{"label":"Set up aliases","href":"Set-up-aliases","type":2,"isActive":false},{"label":"Set Properties","href":"Set-Properties","type":2,"isActive":false},{"label":"Drop a Collection","href":"Drop-a-Collection","type":2,"isActive":false}]} \ No newline at end of file diff --git a/localization/v2.4.x/site/en/userGuide/manage-collections.md b/localization/v2.4.x/site/en/userGuide/manage-collections.md index 60a5a5d48..fb1153ed5 100644 --- a/localization/v2.4.x/site/en/userGuide/manage-collections.md +++ b/localization/v2.4.x/site/en/userGuide/manage-collections.md @@ -1637,7 +1637,7 @@ $ curl -X POST "http://# 7. Load the collection client.load_collection( collection_name="customized_setup_2", - load_fields=["my_id", "my_vector"] # Load only the specified fields + load_fields=["my_id", "my_vector"], # Load only the specified fields skip_load_dynamic_field=True # Skip loading the dynamic field )