Skip to content

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

make term similarity robust (#2212)

Kevin Hu5a2c542ce228
diff --git a/rag/nlp/query.py b/rag/nlp/query.py
index a8d2d0b596..81a4bc304f 100644
--- a/rag/nlp/query.py
+++ b/rag/nlp/query.py
@@ -106,10 +106,9 @@ class EsQueryer:
m) for m in sm]
sm = [EsQueryer.subSpecialChar(m) for m in sm if len(m) > 1]
sm = [m for m in sm if len(m) > 1]
- if len(sm) < 2:
- sm = []
keywords.append(re.sub(r"[ \\\"']+", "", tk))
+ keywords.extend(sm)
if len(keywords) >= 12: break
tk_syns = self.syn.lookup(tk)