logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

116 lines
2.9 KiB

# ANN Insert Operator: MilvusClient
2 years ago
<br />
## Desription
Insert data into Milvus collections. **Please make sure you have [created Milvus Collection](https://milvus.io/docs/v2.0.x/create_collection.md) before loading the data.**
<br />
## Code Example
### Example
```python
import towhee
from towhee import ops
p = (
towhee.pipe.input('collection_name', 'vec')
2 years ago
.map(('collection_name', 'vec'), (), ops.ann_insert.osschat_milvus(host='127.0.0.1', port='19530'))
.output()
)
p(vec)
```
### Load Collection
> Please load the Collection after inserted data.
```python
collection.load()
```
<br />
## Factory Constructor
Create the operator via the following factory method:
***ann_insert.milvus_client(host, port, user= None, password=None, collection_schema=None, index_params=None)***
**Parameters:**
You must provide at least one valid value for uri or host/port.
The order of use: uri > host/port, token > user/password.
***uri:*** *str*
The uri for Milvus, defaults to "http://localhost:19530"
***host:*** *str*
The host for Milvus.
***port:*** *str*
The port for Milvus.
***token:*** *str*
The token for Milvus.
***user:*** *str*
The user for Zilliz Cloud, defaults to None.
***password:*** *str*
The password for Zilliz Cloud, defaults to None.
<br />
## Interface
Insert Milvus data.
**Parameters:**
***collection_name:*** *str*
The collection name for Milvus.
***data:*** *list*
The data to insert into milvus.
**Returns:** MutationResult
A MutationResult object contains `insert_count` represents how many and a `primary_keys` of primary keys.
# More Resources
- [Introducing Milvus 2.3.4 - Zilliz blog](https://zilliz.com/blog/what-is-new-in-milvus-2-3-4): Introducing Milvus 2.3.4 with the support for Access Logs, Parquet File imports, expanded collections/partitions, and more!
- [Milvus support for multiple Index types - Zilliz blog](https://zilliz.com/blog/Milvus-Index-Types-Supported): One of the essential features of Milvus is the support for various Index types; Indexes help to optimize data querying and retrieval.
- [Optimizing Data Communication: Milvus Embraces NATS Messaging - Zilliz blog](https://zilliz.com/blog/optimizing-data-communication-milvus-embraces-nats-messaging): Introducing the integration of NATS and Milvus, exploring its features, setup and migration process, and performance testing results.
- [.NET SDK for the Milvus Open Source Vector Database](https://zilliz.com/product/integrations/.NET): nan
- [Spring AI and Milvus: Using Milvus as a Spring AI Vector Store - Zilliz blog](https://zilliz.com/blog/spring-ai-and-milvus-using-milvus-as-spring-ai-vector-store): A comprehensive guide on how to use Milvus as a Spring AI vector store
- [JSON and Metadata Filtering in Milvus - Zilliz blog](https://zilliz.com/blog/json-metadata-filtering-in-milvus): A brief review of how to ingest your data with JSON in your Milvus vector database