refac/fix: hybrid search
This commit is contained in:
1 parent
4267e22d4a
commit
23a9731899
1 file changed
+4
@@ -124,6 +124,10 @@ def query_doc_with_hybrid_search(
|
|||||||
hybrid_bm25_weight: float,
|
hybrid_bm25_weight: float,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
try:
|
try:
|
||||||
|
if not collection_result.documents[0]:
|
||||||
|
log.warning(f"query_doc_with_hybrid_search:no_docs {collection_name}")
|
||||||
|
return {"documents": [], "metadatas": [], "distances": []}
|
||||||
|
|
||||||
# BM_25 required only if weight is greater than 0
|
# BM_25 required only if weight is greater than 0
|
||||||
if hybrid_bm25_weight > 0:
|
if hybrid_bm25_weight > 0:
|
||||||
log.debug(f"query_doc_with_hybrid_search:doc {collection_name}")
|
log.debug(f"query_doc_with_hybrid_search:doc {collection_name}")
|
||||||
|
|||||||
Reference in new issue
Block a user