Skip to content

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

fix: empty token bug (#3424)

Kevin Hua1ba228bc25a
diff --git a/rag/nlp/query.py b/rag/nlp/query.py
index f81de2cbec..8b1400c316 100644
--- a/rag/nlp/query.py
+++ b/rag/nlp/query.py
@@ -88,7 +88,7 @@ class FulltextQueryer:
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn]
syns.append(" ".join(syn))
- q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns)]
+ q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk]
for i in range(1, len(tks_w)):
q.append(
'"%s %s"^%.4f'