Browse Source
Update output
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
2 changed files with
8 additions and
6 deletions
-
README.md
-
osschat_insert.py
|
|
@ -156,7 +156,7 @@ The user password for Elasticsearch, defaults to `None`. |
|
|
|
|
|
|
|
## Interface |
|
|
|
|
|
|
|
Insert documentation into Milvus as a knowledge base. |
|
|
|
Insert documentation into Milvus(and Elasticsearch) as a knowledge base. |
|
|
|
|
|
|
|
**Parameters:** |
|
|
|
|
|
|
@ -166,10 +166,10 @@ Path or url of the document to be loaded. |
|
|
|
|
|
|
|
***project_name***: str |
|
|
|
|
|
|
|
The collection name for Milvus vector database, also the index name of elasticsearch. |
|
|
|
The collection name for Milvus vector database, also the index name of Elasticsearch. |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
**Returns:** MutationResult |
|
|
|
**Returns:** dict |
|
|
|
|
|
|
|
A MutationResult after inserting Milvus. |
|
|
|
A dictionary includes 'milvus_res' and 'es_res'. |
|
|
|
|
|
@ -110,6 +110,8 @@ def osschat_insert_pipe(config): |
|
|
|
p = ( |
|
|
|
p.map('sentence', 'es_sentence', lambda x: {'sentence': x}) |
|
|
|
.map(('project_name', 'es_sentence'), 'es_res', es_index_op) |
|
|
|
.map(('milvus_res', 'es_res'), 'res', lambda x, y: {'milvus_res': x, 'es_res': y}) |
|
|
|
) |
|
|
|
return p.output('milvus_res', 'es_res') |
|
|
|
return p.output('milvus_res') |
|
|
|
else: |
|
|
|
p = p.map('milvus_res', 'res', lambda x: {'milvus_res': x, 'es_res': None}) |
|
|
|
return p.output('res') |
|
|
|