milvus collections (#11148)

Description: There was no information about Milvus collections in the
documentation, so I am adding that.
Maintainer: @eyurtsev
pull/11113/head^2
Apurv Agarwal 1 year ago committed by GitHub
parent 8ae9b71e41
commit 7bb6d04fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -139,13 +139,68 @@
"docs[0].page_content"
]
},
{
"cell_type": "markdown",
"id": "e40d558b",
"metadata": {},
"source": [
"### Compartmentalize the data with Milvus Collections\n",
"\n",
"You can store different unrelated documents in different collections within same Milvus instance to maintain the context"
]
},
{
"cell_type": "markdown",
"id": "82c00f6e",
"metadata": {},
"source": [
"Here's how you can create a new collection"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e40d558b",
"id": "f7ff38ab",
"metadata": {},
"outputs": [],
"source": [
"vector_db = Milvus.from_documents(\n",
" docs,\n",
" embeddings,\n",
" collection_name = 'collection_1',\n",
" connection_args={\"host\": \"127.0.0.1\", \"port\": \"19530\"},\n",
")"
]
},
{
"cell_type": "markdown",
"id": "891cec1f",
"metadata": {},
"source": [
"And here is how you retrieve that stored collection"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e9e873e9",
"metadata": {},
"outputs": [],
"source": []
"source": [
"vector_db = Milvus(\n",
" embeddings,\n",
" connection_args={\"host\": \"127.0.0.1\", \"port\": \"19530\"},\n",
" collection_name = 'collection_1'\n",
" )"
]
},
{
"cell_type": "markdown",
"id": "9cc65535",
"metadata": {},
"source": [
"After retreival you can go on querying it as usual."
]
}
],
"metadata": {

Loading…
Cancel
Save