Skip to content

Commit f80d3df

Browse files
Milvus-doc-botMilvus-doc-bot
Milvus-doc-bot
authored and
Milvus-doc-bot
committed
Generate en docs
1 parent d15a42d commit f80d3df

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"codeList":["from pymilvus import FieldSchema\nid_field = FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True, description=\"primary id\")\nage_field = FieldSchema(name=\"age\", dtype=DataType.INT64, description=\"age\")\nembedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n\n# The following creates a field and use it as the partition key\nposition_field = FieldSchema(name=\"position\", dtype=DataType.VARCHAR, max_length=256, is_partition_key=True)\n","from pymilvus import FieldSchema\n\nfields = [\n FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True),\n # configure default value `25` for field `age`\n FieldSchema(name=\"age\", dtype=DataType.INT64, default_value=25, description=\"age\"),\n embedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n]\n","from pymilvus import FieldSchema, CollectionSchema\nid_field = FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True, description=\"primary id\")\nage_field = FieldSchema(name=\"age\", dtype=DataType.INT64, description=\"age\")\nembedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n\n# Enable partition key on a field if you need to implement multi-tenancy based on the partition-key field\nposition_field = FieldSchema(name=\"position\", dtype=DataType.VARCHAR, max_length=256, is_partition_key=True)\n\n# Set enable_dynamic_field to True if you need to use dynamic fields. \nschema = CollectionSchema(fields=[id_field, age_field, embedding_field], auto_id=False, enable_dynamic_field=True, description=\"desc of a collection\")\n","from pymilvus import Collection\ncollection_name1 = \"tutorial_1\"\ncollection1 = Collection(name=collection_name1, schema=schema, using='default', shards_num=2)\n","import pandas as pd\ndf = pd.DataFrame({\n \"id\": [i for i in range(nb)],\n \"age\": [random.randint(20, 40) for i in range(nb)],\n \"embedding\": [[random.random() for _ in range(dim)] for _ in range(nb)],\n \"position\": \"test_pos\"\n})\n\ncollection, ins_res = Collection.construct_from_dataframe(\n 'my_collection',\n df,\n primary_field='id',\n auto_id=False\n )\n"],"headingContent":"Manage Schema","anchorList":[{"label":"Manage Schema","href":"Manage-Schema","type":1,"isActive":false},{"label":"Field schema","href":"Field-schema","type":2,"isActive":false},{"label":"Collection schema","href":"Collection-schema","type":2,"isActive":false},{"label":"What's next","href":"Whats-next","type":2,"isActive":false}]}
1+
{"codeList":["from pymilvus import FieldSchema\nid_field = FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True, description=\"primary id\")\nage_field = FieldSchema(name=\"age\", dtype=DataType.INT64, description=\"age\")\nembedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n\n# The following creates a field and use it as the partition key\nposition_field = FieldSchema(name=\"position\", dtype=DataType.VARCHAR, max_length=256, is_partition_key=True)\n","from pymilvus import FieldSchema\n\nfields = [\n FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True),\n # configure default value `25` for field `age`\n FieldSchema(name=\"age\", dtype=DataType.INT64, default_value=25, description=\"age\"),\n embedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n]\n","from pymilvus import FieldSchema, CollectionSchema\nid_field = FieldSchema(name=\"id\", dtype=DataType.INT64, is_primary=True, description=\"primary id\")\nage_field = FieldSchema(name=\"age\", dtype=DataType.INT64, description=\"age\")\nembedding_field = FieldSchema(name=\"embedding\", dtype=DataType.FLOAT_VECTOR, dim=128, description=\"vector\")\n\n# Enable partition key on a field if you need to implement multi-tenancy based on the partition-key field\nposition_field = FieldSchema(name=\"position\", dtype=DataType.VARCHAR, max_length=256, is_partition_key=True)\n\n# Set enable_dynamic_field to True if you need to use dynamic fields. \nschema = CollectionSchema(fields=[id_field, age_field, embedding_field], auto_id=False, enable_dynamic_field=True, description=\"desc of a collection\")\n","from pymilvus import Collection,connections\nconn = connections.connect(host=\"127.0.0.1\", port=19530)\ncollection_name1 = \"tutorial_1\"\ncollection1 = Collection(name=collection_name1, schema=schema, using='default', shards_num=2)\n","import pandas as pd\ndf = pd.DataFrame({\n \"id\": [i for i in range(nb)],\n \"age\": [random.randint(20, 40) for i in range(nb)],\n \"embedding\": [[random.random() for _ in range(dim)] for _ in range(nb)],\n \"position\": \"test_pos\"\n})\n\ncollection, ins_res = Collection.construct_from_dataframe(\n 'my_collection',\n df,\n primary_field='id',\n auto_id=False\n )\n"],"headingContent":"Manage Schema","anchorList":[{"label":"Manage Schema","href":"Manage-Schema","type":1,"isActive":false},{"label":"Field schema","href":"Field-schema","type":2,"isActive":false},{"label":"Collection schema","href":"Collection-schema","type":2,"isActive":false},{"label":"What's next","href":"Whats-next","type":2,"isActive":false}]}

localization/v2.4.x/site/en/reference/schema.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ title: Manage Schema
3939
<h3 id="Field-schema-properties" class="common-anchor-header">Field schema properties</h3><table class="properties">
4040
<thead>
4141
<tr>
42-
<th>Properties</td>
42+
<th>Properties</th>
4343
<th>Description</th>
4444
<th>Note</th>
4545
</tr>
@@ -157,7 +157,7 @@ fields = [
157157
<h3 id="Collection-schema-properties" class="common-anchor-header">Collection schema properties</h3><table class="properties">
158158
<thead>
159159
<tr>
160-
<th>Properties</td>
160+
<th>Properties</th>
161161
<th>Description</th>
162162
<th>Note</th>
163163
</tr>
@@ -200,7 +200,8 @@ position_field = FieldSchema(name=<span class="hljs-string">&quot;position&quot;
200200
schema = CollectionSchema(fields=[id_field, age_field, embedding_field], auto_id=<span class="hljs-literal">False</span>, enable_dynamic_field=<span class="hljs-literal">True</span>, description=<span class="hljs-string">&quot;desc of a collection&quot;</span>)
201201
<button class="copy-code-btn"></button></code></pre>
202202
<p>Create a collection with the schema specified:</p>
203-
<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_">Collection</span>
203+
<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_">Collection</span>,connections
204+
conn = connections.<span class="hljs-title function_">connect</span>(host=<span class="hljs-string">&quot;127.0.0.1&quot;</span>, port=<span class="hljs-number">19530</span>)
204205
collection_name1 = <span class="hljs-string">&quot;tutorial_1&quot;</span>
205206
collection1 = <span class="hljs-title class_">Collection</span>(name=collection_name1, schema=schema, using=<span class="hljs-string">&#x27;default&#x27;</span>, shards_num=<span class="hljs-number">2</span>)
206207
<button class="copy-code-btn"></button></code></pre>

localization/v2.4.x/site/en/userGuide/manage-collections.json

+1-1
Large diffs are not rendered by default.

localization/v2.4.x/site/en/userGuide/manage-collections.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ $ curl -X POST <span class="hljs-string">&quot;http://<span class="hljs-variable
16371637
<pre><code translate="no" class="language-python"><span class="hljs-comment"># 7. Load the collection</span>
16381638
client.load_collection(
16391639
collection_name=<span class="hljs-string">&quot;customized_setup_2&quot;</span>,
1640-
load_fields=[<span class="hljs-string">&quot;my_id&quot;</span>, <span class="hljs-string">&quot;my_vector&quot;</span>] <span class="hljs-comment"># Load only the specified fields</span>
1640+
load_fields=[<span class="hljs-string">&quot;my_id&quot;</span>, <span class="hljs-string">&quot;my_vector&quot;</span>], <span class="hljs-comment"># Load only the specified fields</span>
16411641
skip_load_dynamic_field=<span class="hljs-literal">True</span> <span class="hljs-comment"># Skip loading the dynamic field</span>
16421642
)
16431643

0 commit comments

Comments
 (0)