Skip to content

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

Fix: empty tag field issue. (#6103)

Kevin Hue5a8b2368497
diff --git a/rag/nlp/search.py b/rag/nlp/search.py
index 86416cd496..1e83969e4f 100644
--- a/rag/nlp/search.py
+++ b/rag/nlp/search.py
@@ -258,6 +258,8 @@ class Dealer:
q_denor = np.sqrt(np.sum([s*s for t,s in query_rfea.items() if t != PAGERANK_FLD]))
for i in search_res.ids:
nor, denor = 0, 0
+ if not search_res.field[i].get(TAG_FLD):
+ continue
for t, sc in eval(search_res.field[i].get(TAG_FLD, "{}")).items():
if t in query_rfea:
nor += query_rfea[t] * sc