refac: limit the number of search words used for chat search (#33844)

Chat search now uses at most the first 12 distinct words of the query.
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-08 10:43:19 +09:00
1 parent d2a8374f3a
commit 639766f7f9
1 file changed
+1 -1
+1 -1
View File
@@ -58,7 +58,7 @@ def chat_search_content_query(text: str) -> str:
def chat_search_terms(text: str) -> list[str]:
return list(dict.fromkeys(re.findall(r'[a-z0-9]+', text.lower())))
return list(dict.fromkeys(re.findall(r'[a-z0-9]+', text.lower())))[:12]
def chat_message_list(chat: dict) -> list: