Spaces:
Running
Running
Update qdrant_service.py
Browse files- qdrant_service.py +4 -5
qdrant_service.py
CHANGED
|
@@ -251,10 +251,10 @@ class QdrantVectorService:
|
|
| 251 |
if len(query_embedding.shape) > 1:
|
| 252 |
query_embedding = query_embedding.flatten()
|
| 253 |
|
| 254 |
-
# Search với HNSW parameters tối ưu
|
| 255 |
-
search_result = self.client.
|
| 256 |
collection_name=self.collection_name,
|
| 257 |
-
|
| 258 |
limit=limit,
|
| 259 |
score_threshold=score_threshold,
|
| 260 |
query_filter=filter_conditions,
|
|
@@ -268,8 +268,7 @@ class QdrantVectorService:
|
|
| 268 |
)
|
| 269 |
),
|
| 270 |
with_payload=True,
|
| 271 |
-
|
| 272 |
-
)
|
| 273 |
|
| 274 |
# Format results - trả về original_id thay vì UUID
|
| 275 |
results = []
|
|
|
|
| 251 |
if len(query_embedding.shape) > 1:
|
| 252 |
query_embedding = query_embedding.flatten()
|
| 253 |
|
| 254 |
+
# Search với HNSW parameters tối ưu (qdrant-client v1.16.0+)
|
| 255 |
+
search_result = self.client.query_points(
|
| 256 |
collection_name=self.collection_name,
|
| 257 |
+
query=query_embedding.tolist(),
|
| 258 |
limit=limit,
|
| 259 |
score_threshold=score_threshold,
|
| 260 |
query_filter=filter_conditions,
|
|
|
|
| 268 |
)
|
| 269 |
),
|
| 270 |
with_payload=True,
|
| 271 |
+
).points
|
|
|
|
| 272 |
|
| 273 |
# Format results - trả về original_id thay vì UUID
|
| 274 |
results = []
|