Skip to content

Commit ac7a8c0

Browse files
committed
qdrant insertion bug fix
1 parent 3b5de0e commit ac7a8c0

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

bbconf/modules/bedfiles.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,11 +2197,12 @@ def reindex_hybrid_search(self, batch: int = 1000, purge: bool = False) -> None:
21972197
pbar.write(f"File: {result.id} successfully indexed.")
21982198
pbar.update(1)
21992199

2200-
operation_info = self.config.qdrant_client.upsert(
2201-
collection_name=self.config.config.qdrant.search_collection,
2202-
points=points,
2203-
)
2204-
assert operation_info.status == "completed"
2200+
if points:
2201+
operation_info = self.config.qdrant_client.upsert(
2202+
collection_name=self.config.config.qdrant.search_collection,
2203+
points=points,
2204+
)
2205+
assert operation_info.status == "completed"
22052206
session.commit()
22062207

22072208
return None
@@ -2344,14 +2345,20 @@ def hybrid_search(
23442345

23452346
hybrid_query = [
23462347
# Dense retrieval: semantic understanding
2347-
models.Prefetch(query=dense_query, using="dense", limit=limit),
2348+
models.Prefetch(
2349+
query=dense_query, using="dense", limit=limit + offset + 100
2350+
),
23482351
# Sparse retrieval: exact technical term matching
2349-
models.Prefetch(query=sparse_embeddings, using="sparse", limit=limit),
2352+
models.Prefetch(
2353+
query=sparse_embeddings, using="sparse", limit=limit + offset + 100
2354+
),
23502355
]
23512356
else:
23522357
hybrid_query = [
23532358
# Dense retrieval: semantic understanding
2354-
models.Prefetch(query=dense_query, using="dense", limit=limit),
2359+
models.Prefetch(
2360+
query=dense_query, using="dense", limit=limit + offset + 100
2361+
),
23552362
]
23562363

23572364
results = self.config.qdrant_client.query_points(

requirements/requirements-all.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
yacman >= 0.9.1
22
sqlalchemy >= 2.0.0
3-
gtars >= 0.4.0
3+
gtars >= 0.5.2
44
geniml[ml] >= 0.8.3
55
psycopg >= 3.1.15
66
coloredlogs
@@ -15,3 +15,4 @@ s3fs >= 2024.3.1
1515
pandas >= 2.0.0
1616
pybiocfilecache == 0.6.1
1717
umap-learn >= 0.5.8
18+
qdrant_client >= 1.16.1

0 commit comments

Comments
 (0)