fix: hybrid search finds nothing when a collection cannot be read (#31460)

With hybrid search on and a vector database without built-in hybrid search, a collection that failed to load (for example Qdrant strict mode rejecting the request) was skipped quietly, so retrieval returned no documents and never fell back to normal vector search. A failed load now counts as a failed collection, so when every collection fails retrieval falls back to vector search, the same way it already does when the search itself fails. The retrieval API returns its usual error in that case.

Part of #31459
This commit is contained in:
Classic298 2026-09-27 20:59:02 +02:00 • committed by GitHub
parent 8a90f0fc93
commit eda8d85361
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -838,6 +838,7 @@ async def query_collection_with_hybrid_search(
return name, await ASYNC_VECTOR_DB_CLIENT.get(collection_name=name)
except Exception as e:
log.exception(f'Failed to fetch collection {name}: {e}')
failed_collection_names.add(name)
return name, None
collection_results = dict(await asyncio.gather(*(_fetch_collection(name) for name in collection_names)))