diff --git a/localization/v2.4.x/site/en/reference/schema.json b/localization/v2.4.x/site/en/reference/schema.json index 6d07edbc9..b2390ab59 100644 --- a/localization/v2.4.x/site/en/reference/schema.json +++ b/localization/v2.4.x/site/en/reference/schema.json @@ -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}]} \ No newline at end of file +{"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}]} \ No newline at end of file diff --git a/localization/v2.4.x/site/en/reference/schema.md b/localization/v2.4.x/site/en/reference/schema.md index c72790d0b..0e1fcc8fe 100644 --- a/localization/v2.4.x/site/en/reference/schema.md +++ b/localization/v2.4.x/site/en/reference/schema.md @@ -39,7 +39,7 @@ title: Manage Schema

Field schema properties

- @@ -157,7 +157,7 @@ fields = [

Collection schema properties

Properties + Properties Description Note
- @@ -200,7 +200,8 @@ position_field = FieldSchema(name="position" schema = CollectionSchema(fields=[id_field, age_field, embedding_field], auto_id=False, enable_dynamic_field=True, description="desc of a collection")

Create a collection with the schema specified:

-
from pymilvus import Collection
+
from pymilvus import Collection,connections
+conn = connections.connect(host="127.0.0.1", port=19530)
 collection_name1 = "tutorial_1"
 collection1 = Collection(name=collection_name1, schema=schema, using='default', shards_num=2)
 
diff --git a/localization/v2.4.x/site/en/tutorials/tutorials-overview.md b/localization/v2.4.x/site/en/tutorials/tutorials-overview.md index 7a6f870cd..7bfa735e0 100644 --- a/localization/v2.4.x/site/en/tutorials/tutorials-overview.md +++ b/localization/v2.4.x/site/en/tutorials/tutorials-overview.md @@ -28,7 +28,7 @@ title: Tutorials Overview
- +
Properties + Properties Description Note
Multimodal RAG with MilvusRAGvector search, dynamic field
Image Search with MilvusSemantic Searchvector search, dynamic field
Hybrid Search with MilvusHybrid Searchhybrid search, multi vector, dense embedding, sparse embedding
Multimodal Search using multi vectorsSemantic Searchmulti vector, hybrid search
Multimodal Search using Multi VectorsSemantic Searchmulti vector, hybrid search
Question Answering SystemQuestion Answeringvector search
Recommender SystemRecommendation Systemvector search
Video Similarity SearchSemantic Searchvector search