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

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
pull/15651/head
kenwoodjw 11 months ago committed by GitHub
parent 5019547d33
commit 087bb60b31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save