mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 04:56:02 +08:00
fix: preserve Unicode characters in keyword search queries (#15522)
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
This commit is contained in:
parent
5019547d33
commit
087bb60b31
@ -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]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user