From 07357afcf6a9f06b56cdfc85eec8b8b1512c66d7 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 26 Aug 2025 16:54:36 +0400 Subject: [PATCH] refac Co-Authored-By: _00_ <131402327+rgaricano@users.noreply.github.com> --- backend/open_webui/routers/retrieval.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index 738f2d05fc..fdb7786258 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -2075,7 +2075,9 @@ def query_doc_handler( user=Depends(get_verified_user), ): try: - if request.app.state.config.ENABLE_RAG_HYBRID_SEARCH: + if request.app.state.config.ENABLE_RAG_HYBRID_SEARCH and ( + form_data.hybrid is None or form_data.hybrid + ): collection_results = {} collection_results[form_data.collection_name] = VECTOR_DB_CLIENT.get( collection_name=form_data.collection_name @@ -2145,7 +2147,9 @@ def query_collection_handler( user=Depends(get_verified_user), ): try: - if request.app.state.config.ENABLE_RAG_HYBRID_SEARCH: + if request.app.state.config.ENABLE_RAG_HYBRID_SEARCH and ( + form_data.hybrid is None or form_data.hybrid + ): return query_collection_with_hybrid_search( collection_names=form_data.collection_names, queries=[form_data.query],