Join searched messages by linebreak to avoid searching for implicit whitespace.

d48ebdb0d48ae8d8770ddb1f6166218f85fc06b8

Murad "Gness Erquint" Beybalaev <gness.na@gmail.com>

Signed
1 files changed, +1 -1Ignore whitespace
src/endpoints/chats.js+1 -1
@@ -785,7 +785,7 @@ router.post('/search', validateAvatarUrlMiddleware, function (request, response)
785785
786 // Search through chats786 // Search through chats
787 const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);787 const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);
788 const text = messages.map(message => message?.mes).join('').toLowerCase();788 const text = messages.map(message => message?.mes).join("\n").toLowerCase();
789 const stem = chatFile.path.toLowerCase().split(/[\\\/]/).pop().replace(/.jsonl$/, '');789 const stem = chatFile.path.toLowerCase().split(/[\\\/]/).pop().replace(/.jsonl$/, '');
790 const hasMatch = fragments.every(fragment => (stem + text).includes(fragment));790 const hasMatch = fragments.every(fragment => (stem + text).includes(fragment));
791791