From 98c6c9603e3c9f305a5cf49b6011012ce5da7d3b Mon Sep 17 00:00:00 2001 From: Earlee Date: Mon, 8 Jan 2024 01:33:47 +0800 Subject: [PATCH] community: fix: should flush after inserting data on milvus (#15568) The inserted data cannot take effect immediately. We should flush after inserting data on milvus. --- libs/community/langchain_community/vectorstores/milvus.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/community/langchain_community/vectorstores/milvus.py b/libs/community/langchain_community/vectorstores/milvus.py index 476f165121..692f2084d5 100644 --- a/libs/community/langchain_community/vectorstores/milvus.py +++ b/libs/community/langchain_community/vectorstores/milvus.py @@ -528,6 +528,7 @@ class Milvus(VectorStore): "Failed to insert batch starting at entity: %s/%s", i, total_count ) raise e + self.col.flush() return pks def similarity_search(