mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Prepend title to chat messages array before concatenating the string.
This commit is contained in:
@@ -785,9 +785,9 @@ router.post('/search', validateAvatarUrlMiddleware, function (request, response)
|
|||||||
|
|
||||||
// Search through chats
|
// Search through chats
|
||||||
const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);
|
const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x);
|
||||||
const text = messages.map(message => message?.mes).join("\n").toLowerCase();
|
const text = [chatFile.path.split(/[\\\/]/).pop().replace(/.jsonl$/, ''),
|
||||||
const stem = chatFile.path.toLowerCase().split(/[\\\/]/).pop().replace(/.jsonl$/, '');
|
...messages.map(message => message?.mes)].join("\n").toLowerCase();
|
||||||
const hasMatch = fragments.every(fragment => (stem + text).includes(fragment));
|
const hasMatch = fragments.every(fragment => (text).includes(fragment));
|
||||||
|
|
||||||
if (hasMatch) {
|
if (hasMatch) {
|
||||||
results.push({
|
results.push({
|
||||||
|
Reference in New Issue
Block a user