mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #19023] [CLOSED] Fix hybrid search reranking 17046 #48111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/19023
Author: @krishna-medapati
Created: 11/7/2025
Status: ❌ Closed
Base:
main← Head:fix-hybrid-search-reranking-17046📝 Commits (2)
8083299docs: add web loaders documentation and usage guide39f7427fix: Handle AttributeError in hybrid search with reranking (#17046)📊 Changes
2 files changed (+48 additions, -1 deletions)
View changed files
📝
backend/open_webui/retrieval/utils.py(+9 -1)➕
docs/web-loaders.md(+39 -0)📄 Description
Description
Fixes #17046 - AttributeError when using hybrid search with reranking enabled.
Problem
The current code attempts to access
collection_result.documentsin the conditional check even after usinghasattr(). Due to Python's short-circuit evaluation behavior, whencollection_resultis a list or doesn't have thedocumentsattribute, the subsequent conditions still try to access.documents, causing anAttributeError.Solution
Split the attribute existence checks from the content validation checks:
documentsandmetadatasattributes existChanges
hasattr()check formetadatasattribute (was missing)AttributeErrorwhile maintaining all original validation logicTesting
Impact
This fix ensures that hybrid search with reranking works correctly without throwing
AttributeErrorwhen the collection result doesn't have the expected structure.By submitting this pull request, I confirm that my contribution is made under the terms of the contributor license agreement.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.