Skip to content

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

Fix: rank feat issue. (#6225)

Kevin Hu6e8d0e31774e
diff --git a/rag/nlp/search.py b/rag/nlp/search.py
index ba2ee3ffe1..7604bf2c16 100644
--- a/rag/nlp/search.py
+++ b/rag/nlp/search.py
@@ -259,6 +259,7 @@ class Dealer:
for i in search_res.ids:
nor, denor = 0, 0
if not search_res.field[i].get(TAG_FLD):
+ rank_fea.append(0)
continue
for t, sc in eval(search_res.field[i].get(TAG_FLD, "{}")).items():
if t in query_rfea:
diff --git a/rag/utils/__init__.py b/rag/utils/__init__.py
index c9a007d1b7..11a2f7db95 100644
--- a/rag/utils/__init__.py
+++ b/rag/utils/__init__.py
@@ -100,7 +100,7 @@ def clean_markdown_block(text):
return text.strip()
-def get_float(v: str | None):
+def get_float(v: str | int | float | None):
if v is None:
return float('-inf')
try: