Skip to content

Commit c225601

Browse files
Milvus-doc-botMilvus-doc-bot
Milvus-doc-bot
authored and
Milvus-doc-bot
committed
Release new docs to master
1 parent a66bddb commit c225601

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

v2.5.x/site/en/reference/schema.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ To reduce the complexity in data inserts, Milvus allows you to specify a default
7777
Create a regular field schema:
7878

7979
```python
80-
from pymilvus import FieldSchema
80+
from pymilvus import DataType, FieldSchema
8181
id_field = FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, description="primary id")
8282
age_field = FieldSchema(name="age", dtype=DataType.INT64, description="age")
8383
embedding_field = FieldSchema(name="embedding", dtype=DataType.FLOAT_VECTOR, dim=128, description="vector")
@@ -89,7 +89,7 @@ position_field = FieldSchema(name="position", dtype=DataType.VARCHAR, max_length
8989
Create a field schema with default field values:
9090

9191
```python
92-
from pymilvus import FieldSchema
92+
from pymilvus import DataType, FieldSchema
9393

9494
fields = [
9595
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True),
@@ -174,7 +174,7 @@ A collection schema is the logical definition of a collection. Usually you need
174174
</div>
175175

176176
```python
177-
from pymilvus import FieldSchema, CollectionSchema
177+
from pymilvus import DataType, FieldSchema, CollectionSchema
178178
id_field = FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, description="primary id")
179179
age_field = FieldSchema(name="age", dtype=DataType.INT64, description="age")
180180
embedding_field = FieldSchema(name="embedding", dtype=DataType.FLOAT_VECTOR, dim=128, description="vector")
@@ -189,7 +189,7 @@ schema = CollectionSchema(fields=[id_field, age_field, embedding_field], auto_id
189189
Create a collection with the schema specified:
190190

191191
```python
192-
from pymilvus import Collection,connections
192+
from pymilvus import Collection, connections
193193
conn = connections.connect(host="127.0.0.1", port=19530)
194194
collection_name1 = "tutorial_1"
195195
collection1 = Collection(name=collection_name1, schema=schema, using='default', shards_num=2)
@@ -207,6 +207,7 @@ collection1 = Collection(name=collection_name1, schema=schema, using='default',
207207
You can also create a collection with <code>Collection.construct_from_dataframe</code>, which automatically generates a collection schema from DataFrame and creates a collection.
208208

209209
```python
210+
from pymilvus import Collection
210211
import pandas as pd
211212
df = pd.DataFrame({
212213
"id": [i for i in range(nb)],

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "v2.4.x",
2+
"version": "v2.5.x",
33
"released": "yes"
44
}

0 commit comments

Comments
 (0)