mirror of
https://github.com/open-webui/open-webui
synced 2025-06-09 07:56:42 +00:00
Merge pull request #12476 from Phlogi/dev-hybrid-search
fix: Avoid secondary error when collection is empty in parallel hybrid search
This commit is contained in:
commit
0f310b3509
@ -320,11 +320,9 @@ def query_collection_with_hybrid_search(
|
|||||||
log.exception(f"Error when querying the collection with hybrid_search: {e}")
|
log.exception(f"Error when querying the collection with hybrid_search: {e}")
|
||||||
return None, e
|
return None, e
|
||||||
|
|
||||||
tasks = [
|
# Prepare tasks for all collections and queries
|
||||||
(collection_name, query)
|
# Avoid running any tasks for collections that failed to fetch data (have assigned None)
|
||||||
for collection_name in collection_names
|
tasks = [(cn, q) for cn in collection_names if collection_results[cn] is not None for q in queries]
|
||||||
for query in queries
|
|
||||||
]
|
|
||||||
|
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
future_results = [executor.submit(process_query, cn, q) for cn, q in tasks]
|
future_results = [executor.submit(process_query, cn, q) for cn, q in tasks]
|
||||||
|
Loading…
Reference in New Issue
Block a user