diff --git a/datapipe/store/qdrant.py b/datapipe/store/qdrant.py index 8d39d154..305b6c92 100644 --- a/datapipe/store/qdrant.py +++ b/datapipe/store/qdrant.py @@ -56,6 +56,7 @@ def __init__( collection_params: CollectionParams, index_schema: Optional[dict] = None, api_key: Optional[str] = None, + force_vectors_to_ram: Optional[bool] = True, ): super().__init__() self.name = name @@ -67,6 +68,7 @@ def __init__( self.inited = False self.client: Optional[QdrantClient] = None self._api_key = api_key + self.force_vectors_to_ram = force_vectors_to_ram pk_columns = [column for column in self.schema if column.primary_key] @@ -93,6 +95,9 @@ def __init_collection(self): self.client.get_collection(self.name) except UnexpectedResponse as e: if e.status_code == 404: + if self.force_vectors_to_ram: + self.collection_params.vectors.on_disk = False + self.client.http.collections_api.create_collection( collection_name=self.name, create_collection=self.collection_params )