RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix invalid query string (e.g. ?) will error search (#18217)
Wang Qibedc395472ec
diff --git a/rag/nlp/search.py b/rag/nlp/search.pyindex a48dd932db..78b876afe7 100644--- a/rag/nlp/search.py+++ b/rag/nlp/search.py@@ -191,7 +191,7 @@ class Dealer:highlightFields = highlightmatchText, keywords = self.qryr.question(qst, min_match=(0.3 if min_match else 0))if emb_mdl is None:- matchExprs = [matchText]+ matchExprs = [matchText] if matchText else []res = await thread_pool_exec(self.dataStore.search, src, highlightFields, filters, matchExprs, orderBy, offset, limit, idx_names, kb_ids, rank_feature=rank_feature)total = self.dataStore.get_total(res)logging.debug("Dealer.search TOTAL: {}".format(total))@@ -208,7 +208,7 @@ class Dealer:src.append(f"q_{len(q_vec)}_vec")fusionExpr = FusionExpr("weighted_sum", topk, {"weights": "0.001,1"})- matchExprs = [matchText, matchDense, fusionExpr]+ matchExprs = [matchText, matchDense, fusionExpr] if matchText else [matchDense]res = await thread_pool_exec(self.dataStore.search, src, highlightFields, filters, matchExprs, orderBy, offset, limit, idx_names, kb_ids, rank_feature=rank_feature)total = self.dataStore.get_total(res)@@ -223,7 +223,17 @@ class Dealer:matchText, _ = self.qryr.question(qst, min_match=(0.1 if min_match else 0))matchDense.extra_options["similarity"] = 0.17res = await thread_pool_exec(- self.dataStore.search, src, highlightFields, filters, [matchText, matchDense, fusionExpr], orderBy, offset, limit, idx_names, kb_ids, rank_feature=rank_feature+ self.dataStore.search,+ src,+ highlightFields,+ filters,+ [matchText, matchDense, fusionExpr] if matchText else [matchDense],+ orderBy,+ offset,+ limit,+ idx_names,+ kb_ids,+ rank_feature=rank_feature,)total = self.dataStore.get_total(res)logging.debug("Dealer.search 2 TOTAL: {}".format(total))