mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
community: add a flag that determines whether to load the milvus collection (#15693)
fix https://github.com/langchain-ai/langchain/issues/15694 --------- Co-authored-by: hyungwookyang <hyungwookyang@worksmobile.com> Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
parent
9e779ca846
commit
ce21392a21
@ -446,9 +446,15 @@ class Milvus(VectorStore):
|
||||
timeout: Optional[float] = None,
|
||||
) -> None:
|
||||
"""Load the collection if available."""
|
||||
from pymilvus import Collection
|
||||
from pymilvus import Collection, utility
|
||||
from pymilvus.client.types import LoadState
|
||||
|
||||
if isinstance(self.col, Collection) and self._get_index() is not None:
|
||||
if (
|
||||
isinstance(self.col, Collection)
|
||||
and self._get_index() is not None
|
||||
and utility.load_state(self.collection_name, using=self.alias)
|
||||
== LoadState.NotLoad
|
||||
):
|
||||
self.col.load(
|
||||
partition_names=partition_names,
|
||||
replica_number=replica_number,
|
||||
|
Loading…
Reference in New Issue
Block a user