mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Join searched messages by linebreak to avoid searching for implicit whitespace.
This commit is contained in:
committed by
GitHub
parent
35fa634f1d
commit
d48ebdb0d4
@@ -785,7 +785,7 @@ router.post('/search', validateAvatarUrlMiddleware, function (request, response)
|
||||
|
||||
// Search through chats
|
||||
const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);
|
||||
const text = messages.map(message => message?.mes).join('').toLowerCase();
|
||||
const text = messages.map(message => message?.mes).join("\n").toLowerCase();
|
||||
const stem = chatFile.path.toLowerCase().split(/[\\\/]/).pop().replace(/.jsonl$/, '');
|
||||
const hasMatch = fragments.every(fragment => (stem + text).includes(fragment));
|
||||
|
||||
|
Reference in New Issue
Block a user