**Description**
Make some functions work with Milvus:
1. get_ids: Get primary keys by field in the metadata
2. delete: Delete one or more entities by ids
3. upsert: Update/Insert one or more entities
**Issue**
None
**Dependencies**
None
**Tag maintainer:**
@hwchase17
**Twitter handle:**
None
---------
Co-authored-by: HoaNQ9 <hoanq.1811@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
"When building a retrieval app, you often have to build it with multiple users in mind. This means that you may be storing data not just for one user, but for many different users, and they should not be able to see eachother’s data.\n",
"When building a retrieval app, you often have to build it with multiple users in mind. This means that you may be storing data not just for one user, but for many different users, and they should not be able to see eachother’s data.\n",
"\n",
"\n",
"Milvus recommends using [partition_key](https://milvus.io/docs/multi_tenancy.md#Partition-key-based-multi-tenancy) to implement multi-tenancy, here is an example."
"Milvus recommends using [partition_key](https://milvus.io/docs/multi_tenancy.md#Partition-key-based-multi-tenancy) to implement multi-tenancy, here is an example."
" partition_key_field=\"namespace\", # Use the \"namespace\" field as the partition key\n",
" partition_key_field=\"namespace\", # Use the \"namespace\" field as the partition key\n",
")"
")"
],
]
},
{
"cell_type": "markdown",
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%%\n"
"name": "#%% md\n"
}
}
}
},
},
{
"cell_type": "markdown",
"source": [
"source": [
"To conduct a search using the partition key, you should include either of the following in the boolean expression of the search request:\n",
"To conduct a search using the partition key, you should include either of the following in the boolean expression of the search request:\n",
"\n",
"\n",
@ -256,21 +262,23 @@
"Do replace `<partition_key>` with the name of the field that is designated as the partition key.\n",
"Do replace `<partition_key>` with the name of the field that is designated as the partition key.\n",
"\n",
"\n",
"Milvus changes to a partition based on the specified partition key, filters entities according to the partition key, and searches among the filtered entities.\n"
"Milvus changes to a partition based on the specified partition key, filters entities according to the partition key, and searches among the filtered entities.\n"
],
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"pycharm": {
"pycharm": {
"name": "#%% md\n"
"name": "#%%\n"
}
}
}
},
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [
"outputs": [
{
{
"data": {
"data": {
"text/plain": "[Document(page_content='i worked at facebook', metadata={'namespace': 'ankush'})]"
"text/plain": [
"[Document(page_content='i worked at facebook', metadata={'namespace': 'ankush'})]"