Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: preserve Unicode characters in keyword search queries (#15522)

kenwoodjw087bb60b316f
diff --git a/api/core/rag/datasource/retrieval_service.py b/api/core/rag/datasource/retrieval_service.py
index bd0996c9c62..0bcfa3098da 100644
--- a/api/core/rag/datasource/retrieval_service.py
+++ b/api/core/rag/datasource/retrieval_service.py
@@ -1,5 +1,4 @@
import concurrent.futures
-import json
from concurrent.futures import ThreadPoolExecutor
from typing import Optional
@@ -243,7 +242,7 @@ class RetrievalService:
@staticmethod
def escape_query_for_search(query: str) -> str:
- return json.dumps(query).strip('"')
+ return query.replace('"', '\\"')
@classmethod
def format_retrieval_documents(cls, documents: list[Document]) -> list[RetrievalSegments]: