From 1cd39e1a81155100a20ab5ee98fc8f96fafbd088 Mon Sep 17 00:00:00 2001 From: "junjie.jiang" Date: Fri, 6 Jan 2023 14:59:09 +0800 Subject: [PATCH] update readme Signed-off-by: junjie.jiang --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 486e441..6d692cf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,51 @@ -# milvus-client +# ANN Search Operator: Milvus +*author: junjie.jiangjjj* + +
+ +## Desription +Search embedding in [Milvus](https://milvus.io/), **please make sure you have inserted data to Milvus Collection**. + +
+ + + +## Code Example + +> Please make sure you have inserted data into Milvus, refer to [ann_insert.milvus_client](https://towhee.io/ann-insert/milvus-client) and [load the collection](https://milvus.io/docs/v2.1.x/load_collection.md) to memory. + + +```python +from towhee.dc2 import pipe, ops + +p = pipe.input('vec') \ + .map('vec', ('id', 'score'), ops.ann_insert.milvus_client(host='127.0.0.1', port='19530', collection_name='textdb')) \ + .output('id', 'score') + +# call pipeline +p(vec_data) +``` + +```python +from towhee.dc2 import pipe, ops + +# search additional info url: + +p = pipe.input('vec') \ + .map('vec', ('id', 'score', 'url'), ops.ann_insert.milvus_client(host='127.0.0.1', port='19530', collection_name='textdb', output_fields=['url'])) \ + .output('id', 'score', 'url') +``` + +
+ + + +## Factory Constructor + +Create the operator via the following factory method: + +***ann_search.milvus_client(host='127.0.0.1', port='19530', collection_name='textdb')*** + + +