mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 19:36:53 +08:00
fix: preserve Unicode characters in keyword search queries (#15522)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import json
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -243,7 +242,7 @@ class RetrievalService:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def escape_query_for_search(query: str) -> str:
|
def escape_query_for_search(query: str) -> str:
|
||||||
return json.dumps(query).strip('"')
|
return query.replace('"', '\\"')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def format_retrieval_documents(cls, documents: list[Document]) -> list[RetrievalSegments]:
|
def format_retrieval_documents(cls, documents: list[Document]) -> list[RetrievalSegments]:
|
||||||
|
|||||||
Reference in New Issue
Block a user