Skip to content

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

Fix search with [+-] crash the search (#18497)

Wang Qi38c18ea9cffa
diff --git a/rag/nlp/query.py b/rag/nlp/query.py
index 081da1325f..f992134c1a 100644
--- a/rag/nlp/query.py
+++ b/rag/nlp/query.py
@@ -53,6 +53,8 @@ class FulltextQueryer(QueryBase):
" ",
rag_tokenizer.tradi2simp(rag_tokenizer.strQ2B(txt.lower())),
).strip()
+ if not rag_tokenizer.tokenize(txt).strip():
+ return None, []
otxt = txt
txt = self.rmWWW(txt)