Skip to content

Commit 566404f

Browse files
committed
feat: Delete client after running search
1 parent f0df547 commit 566404f

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

engine/base_client/search.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ def search_all(
9797
)
9898

9999
total_time = time.perf_counter() - start
100+
101+
self.__class__.delete_client()
102+
100103
return {
101104
"total_time": total_time,
102105
"mean_time": np.mean(latencies),
@@ -116,3 +119,8 @@ def setup_search(self):
116119

117120
def post_search(self):
118121
pass
122+
123+
@classmethod
124+
def delete_client(cls):
125+
pass
126+

engine/clients/qdrant/search.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def init_client(cls, host, distance, connection_params: dict, search_params: dic
3232

3333
@classmethod
3434
def search_one(cls, vector, meta_conditions, top) -> List[Tuple[int, float]]:
35+
# return cls.client.count(collection_name=QDRANT_COLLECTION_NAME)
3536
res = cls.client.search(
3637
collection_name=QDRANT_COLLECTION_NAME,
3738
query_vector=vector,
@@ -42,3 +43,8 @@ def search_one(cls, vector, meta_conditions, top) -> List[Tuple[int, float]]:
4243
),
4344
)
4445
return [(hit.id, hit.score) for hit in res]
46+
47+
@classmethod
48+
def delete_client(cls):
49+
if cls.client is not None:
50+
del cls.client

engine/clients/qdrant/upload.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def upload_batch(
2828
vectors=vectors,
2929
payloads=[payload or {} for payload in metadata],
3030
),
31+
wait=False,
3132
)
3233

3334
@classmethod

experiments/configurations/qdrant-single-node.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@
4545
],
4646
"upload_params": { "parallel": 16, "batch_size": 1024 }
4747
},
48+
{
49+
"name": "qdrant-parallel",
50+
"engine": "qdrant",
51+
"connection_params": { "timeout": 30 },
52+
"collection_params": {
53+
"optimizers_config": { "memmap_threshold": 10000000 }
54+
},
55+
"search_params": [
56+
{ "parallel": 16, "search_params": { "hnsw_ef": 128 } },
57+
{ "parallel": 32, "search_params": { "hnsw_ef": 128 } },
58+
{ "parallel": 100, "search_params": { "hnsw_ef": 128 } }
59+
],
60+
"upload_params": { "parallel": 16, "batch_size": 1024 }
61+
},
4862
{
4963
"name": "qdrant-m-16-ef-128",
5064
"engine": "qdrant",
@@ -147,4 +161,4 @@
147161
],
148162
"upload_params": { "parallel": 16 }
149163
}
150-
]
164+
]

0 commit comments

Comments
 (0)