Skip to content

Commit

Permalink
Generate en docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Milvus-doc-bot authored and Milvus-doc-bot committed Dec 23, 2024
1 parent be4ecf2 commit 4f01d2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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}]}
{"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}]}
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ curl --request POST \​
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"
></path>
</svg>
</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>
</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>
<p>The following code snippet demonstrates how to change the TTL of a collection.​</p>
<div class="multipleCode">
<a href="#python">Python </a>
Expand All @@ -156,8 +156,12 @@ curl --request POST \​
<a href="#go">Go</a>
<a href="#curl">cURL</a>
</div>
<pre><code translate="no" class="language-python"><span class="hljs-comment"># Currently not available for Python</span>
<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>

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

0 comments on commit 4f01d2f

Please sign in to comment.