fix performance of SQL LIKE note search

This commit is contained in:
Hazelnoot 2025-02-14 20:16:39 -05:00
parent 667262dcfb
commit 493000290b

View file

@ -281,7 +281,7 @@ export class SearchService {
if (this.config.fulltextSearch?.provider === 'sqlPgroonga') {
query.andWhere('note.text &@~ :q', { q });
} else {
query.andWhere('LOWER(note.text) LIKE :q', { q: `%${ sqlLikeEscape(q.toLowerCase()) }%` });
query.andWhere('note.text ILIKE :q', { q: `%${ sqlLikeEscape(q) }%` });
}
if (opts.host) {