Skip to content

Commit 4f01d2f

Browse files
Milvus-doc-botMilvus-doc-bot
authored andcommitted
Generate en docs
1 parent be4ecf2 commit 4f01d2f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"codeList":["from pymilvus import MilvusClient​\n​\nclient = MilvusClient(​\n uri=\"http://localhost:19530\",​\n token=\"root:Milvus\"​\n)​\n​\nclient.rename_collection(​\n old_name=\"my_collection\",​\n new_name=\"my_new_collection\"​\n)​\n\n","import io.milvus.v2.service.collection.request.RenameCollectionReq;​\nimport io.milvus.v2.client.ConnectConfig;​\nimport io.milvus.v2.client.MilvusClientV2;​\n​\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";​\nString TOKEN = \"root:Milvus\";​\n​\n// 1. Connect to Milvus server​\nConnectConfig connectConfig = ConnectConfig.builder()​\n .uri(CLUSTER_ENDPOINT)​\n .token(TOKEN)​\n .build();​\n ​\nMilvusClientV2 client = new MilvusClientV2(connectConfig);​\n​\nRenameCollectionReq renameCollectionReq = RenameCollectionReq.builder()​\n .collectionName(\"my_collection\")​\n .newCollectionName(\"my_new_collection\")​\n .build();​\n​\nclient.renameCollection(renameCollectionReq);​\n\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";​\n​\nconst address = \"http://localhost:19530\";​\nconst token = \"root:Milvus\";​\nconst client = new MilvusClient({address, token});​\n​\nconst res = await client.renameCollection({​\n oldName: \"my_collection\",​\n newName: \"my_new_collection\"​\n});​\n\n","import (​\n \"context\"​\n \"fmt\"​\n \"log\"​\n​\n \"github.com/milvus-io/milvus/client/v2\"​\n)​\n​\nctx, cancel := context.WithCancel(context.Background())​\ndefer cancel()​\n​\nmilvusAddr := \"127.0.0.1:19530\"​\ntoken := \"root:Milvus\"​\n​\ncli, err := client.New(ctx, &client.ClientConfig{​\n Address: milvusAddr,​\n APIKey: token,​\n})​\nif err != nil {​\n log.Fatal(\"failed to connect to milvus server: \", err.Error())​\n}​\n​\ndefer cli.Close(ctx)​\n​\nerr = cli.RenameCollection(ctx, client.NewRenameCollectionOption(\"my_collection\", \"my_new_collection\"))​\nif err != nil {​\n // handle error​\n}​\n\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"​\nexport TOKEN=\"root:Milvus\"​\n​\ncurl --request POST \\​\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/rename\" \\​\n--header \"Authorization: Bearer ${TOKEN}\" \\​\n--header \"Content-Type: application/json\" \\​\n-d '{​\n \"collectionName\": \"my_collection\",​\n \"newCollectionName\": \"my_new_collection\"​\n}'​\n\n","# Currently not available for Python\n\n","import io.milvus.v2.service.collection.request.AlterCollectionReq;​\nimport java.util.HashMap;​\nimport java.util.Map;​\n​\nMap<String, String> properties = new HashMap<>();​\nproperties.put(\"collection.ttl.seconds\", \"60\");​\n​\nAlterCollectionReq alterCollectionReq = AlterCollectionReq.builder()​\n .collectionName(\"my_collection\")​\n .properties(properties)​\n .build();​\n​\nclient.alterCollection(alterCollectionReq);​\n\n","res = await client.alterCollection({​\n collection_name: \"my_collection\",​\n properties: {​\n \"collection.ttl.seconds\": 60​\n }​\n})​\n\n","import (​\n \"context\"​\n \"fmt\"​\n \"log\"​\n​\n \"github.com/milvus-io/milvus/client/v2\"​\n \"github.com/milvus-io/milvus/pkg/common\"​\n)​\n​\n​\nctx, cancel := context.WithCancel(context.Background())​\ndefer cancel()​\n​\nmilvusAddr := \"127.0.0.1:19530\"​\ntoken := \"root:Milvus\"​\n​\ncli, err := client.New(ctx, &client.ClientConfig{​\n Address: milvusAddr,​\n APIKey: token,​\n})​\nif err != nil {​\n log.Fatal(\"failed to connect to milvus server: \", err.Error())​\n}​\n​\ndefer cli.Close(ctx)​\n​\nerr = cli.AlterCollection(ctx, client.NewAlterCollectionOption(\"my_collection\").WithProperty(common.CollectionTTLConfigKey, 60))​\nif err != nil {​\n // handle error​\n}​\n\n","# Currently not available for REST\n\n"],"headingContent":"Modify Collection​","anchorList":[{"label":"Modify Collection​","href":"Modify-Collection​","type":1,"isActive":false},{"label":"Rename Collection​","href":"Rename-Collection​","type":2,"isActive":false},{"label":"Set Collection TTL​","href":"Set-Collection-TTL​","type":2,"isActive":false}]}
1+
{"codeList":["from pymilvus import MilvusClient​\n​\nclient = MilvusClient(​\n uri=\"http://localhost:19530\",​\n token=\"root:Milvus\"​\n)​\n​\nclient.rename_collection(​\n old_name=\"my_collection\",​\n new_name=\"my_new_collection\"​\n)​\n\n","import io.milvus.v2.service.collection.request.RenameCollectionReq;​\nimport io.milvus.v2.client.ConnectConfig;​\nimport io.milvus.v2.client.MilvusClientV2;​\n​\nString CLUSTER_ENDPOINT = \"http://localhost:19530\";​\nString TOKEN = \"root:Milvus\";​\n​\n// 1. Connect to Milvus server​\nConnectConfig connectConfig = ConnectConfig.builder()​\n .uri(CLUSTER_ENDPOINT)​\n .token(TOKEN)​\n .build();​\n ​\nMilvusClientV2 client = new MilvusClientV2(connectConfig);​\n​\nRenameCollectionReq renameCollectionReq = RenameCollectionReq.builder()​\n .collectionName(\"my_collection\")​\n .newCollectionName(\"my_new_collection\")​\n .build();​\n​\nclient.renameCollection(renameCollectionReq);​\n\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";​\n​\nconst address = \"http://localhost:19530\";​\nconst token = \"root:Milvus\";​\nconst client = new MilvusClient({address, token});​\n​\nconst res = await client.renameCollection({​\n oldName: \"my_collection\",​\n newName: \"my_new_collection\"​\n});​\n\n","import (​\n \"context\"​\n \"fmt\"​\n \"log\"​\n​\n \"github.com/milvus-io/milvus/client/v2\"​\n)​\n​\nctx, cancel := context.WithCancel(context.Background())​\ndefer cancel()​\n​\nmilvusAddr := \"127.0.0.1:19530\"​\ntoken := \"root:Milvus\"​\n​\ncli, err := client.New(ctx, &client.ClientConfig{​\n Address: milvusAddr,​\n APIKey: token,​\n})​\nif err != nil {​\n log.Fatal(\"failed to connect to milvus server: \", err.Error())​\n}​\n​\ndefer cli.Close(ctx)​\n​\nerr = cli.RenameCollection(ctx, client.NewRenameCollectionOption(\"my_collection\", \"my_new_collection\"))​\nif err != nil {​\n // handle error​\n}​\n\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"​\nexport TOKEN=\"root:Milvus\"​\n​\ncurl --request POST \\​\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/rename\" \\​\n--header \"Authorization: Bearer ${TOKEN}\" \\​\n--header \"Content-Type: application/json\" \\​\n-d '{​\n \"collectionName\": \"my_collection\",​\n \"newCollectionName\": \"my_new_collection\"​\n}'​\n\n","from pymilvus import MilvusClient\n\nclient.alter_collection_properties(\n collection_name=\"collection_name\",\n properties = {\"collection.ttl.seconds\": 500}\n)\n","import io.milvus.v2.service.collection.request.AlterCollectionReq;​\nimport java.util.HashMap;​\nimport java.util.Map;​\n​\nMap<String, String> properties = new HashMap<>();​\nproperties.put(\"collection.ttl.seconds\", \"60\");​\n​\nAlterCollectionReq alterCollectionReq = AlterCollectionReq.builder()​\n .collectionName(\"my_collection\")​\n .properties(properties)​\n .build();​\n​\nclient.alterCollection(alterCollectionReq);​\n\n","res = await client.alterCollection({​\n collection_name: \"my_collection\",​\n properties: {​\n \"collection.ttl.seconds\": 60​\n }​\n})​\n\n","import (​\n \"context\"​\n \"fmt\"​\n \"log\"​\n​\n \"github.com/milvus-io/milvus/client/v2\"​\n \"github.com/milvus-io/milvus/pkg/common\"​\n)​\n​\n​\nctx, cancel := context.WithCancel(context.Background())​\ndefer cancel()​\n​\nmilvusAddr := \"127.0.0.1:19530\"​\ntoken := \"root:Milvus\"​\n​\ncli, err := client.New(ctx, &client.ClientConfig{​\n Address: milvusAddr,​\n APIKey: token,​\n})​\nif err != nil {​\n log.Fatal(\"failed to connect to milvus server: \", err.Error())​\n}​\n​\ndefer cli.Close(ctx)​\n​\nerr = cli.AlterCollection(ctx, client.NewAlterCollectionOption(\"my_collection\").WithProperty(common.CollectionTTLConfigKey, 60))​\nif err != nil {​\n // handle error​\n}​\n\n","# Currently not available for REST\n\n"],"headingContent":"Modify Collection​","anchorList":[{"label":"Modify Collection​","href":"Modify-Collection​","type":1,"isActive":false},{"label":"Rename Collection​","href":"Rename-Collection​","type":2,"isActive":false},{"label":"Set Collection TTL​","href":"Set-Collection-TTL​","type":2,"isActive":false}]}

localization/v2.5.x/site/en/userGuide/collections/modify-collection.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ curl --request POST \​
147147
d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"
148148
></path>
149149
</svg>
150-
</button></h2><p>If a collection needs to be dropped for a specific period, consider setting its Time-To-Live (TTL) in seconds. Once the TTL times out, Milvus deletes entities in the collection and drops the collection. The deletion is asynchronous, indicating that searches and queries are still possible before the deletion is complete.​</p>
150+
</button></h2><p>If a collection needs to be dropped for a specific period, consider setting its Time-To-Live (TTL) in seconds. Once the TTL times out, Milvus deletes entities in the collection. The deletion is asynchronous, indicating that searches and queries are still possible before the deletion is complete.​</p>
151151
<p>The following code snippet demonstrates how to change the TTL of a collection.​</p>
152152
<div class="multipleCode">
153153
<a href="#python">Python </a>
@@ -156,8 +156,12 @@ curl --request POST \​
156156
<a href="#go">Go</a>
157157
<a href="#curl">cURL</a>
158158
</div>
159-
<pre><code translate="no" class="language-python"><span class="hljs-comment"># Currently not available for Python</span>
159+
<pre><code translate="no" class="language-python"><span class="hljs-keyword">from</span> pymilvus <span class="hljs-keyword">import</span> <span class="hljs-title class_">MilvusClient</span>
160160

161+
client.<span class="hljs-title function_">alter_collection_properties</span>(
162+
collection_name=<span class="hljs-string">&quot;collection_name&quot;</span>,
163+
properties = {<span class="hljs-string">&quot;collection.ttl.seconds&quot;</span>: <span class="hljs-number">500</span>}
164+
)
161165
<button class="copy-code-btn"></button></code></pre>
162166
<pre><code translate="no" class="language-java"><span class="hljs-keyword">import</span> io.milvus.v2.service.collection.request.AlterCollectionReq;​
163167
<span class="hljs-keyword">import</span> java.util.HashMap;​

0 commit comments

Comments
 (0)