Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(api): guard missing row in SearchService.get_detail (#15622)

DearsisHScbb3896aaa85
diff --git a/api/db/services/search_service.py b/api/db/services/search_service.py
index 7366a9708b..90d0e0e605 100644
--- a/api/db/services/search_service.py
+++ b/api/db/services/search_service.py
@@ -72,11 +72,10 @@ class SearchService(CommonService):
.join(User, on=((User.id == cls.model.tenant_id) & (User.status == StatusEnum.VALID.value)))
.where((cls.model.id == search_id) & (cls.model.status == StatusEnum.VALID.value))
.first()
- .to_dict()
)
if not search:
return {}
- return search
+ return search.to_dict()
@classmethod
@DB.connection_context()