| 785 | 785 | |
| 786 | 786 | // Search through chats |
| 787 | 787 | const fragments = query.trim().toLowerCase().split(/\s+/).filter(x => x); |
| 788 | | - const text = messages.map(message => message?.mes).join("\n").toLowerCase(); |
| 788 | + const text = [chatFile.path.split(/[\\\/]/).pop().replace(/.jsonl$/, ''), |
| 789 | | - const stem = chatFile.path.toLowerCase().split(/[\\\/]/).pop().replace(/.jsonl$/, ''); |
| 789 | + ...messages.map(message => message?.mes)].join("\n").toLowerCase(); |
| 790 | 790 | const hasMatch = fragments.every(fragment => (stem + text).includes(fragment)); |
| 791 | 791 | |
| 792 | 792 | if (hasMatch) { |
| 793 | 793 | results.push({ |