fix(backend): pgroongaでの検索時にはじめのキーワード以外が検索に使用されない問題を修正 (#15496)

* fix pgroona note.text query

* Update Changelog

---------

Co-authored-by: Hazelnoot <acomputerdog@gmail.com>
This commit is contained in:
かっこかり 2025-02-15 19:26:02 +09:00 committed by GitHub
parent 9611bfbbf7
commit 88900492a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,8 @@
### Server
- Fix: `following/invalidate`でフォロワーを解除しようとしているユーザーの情報を返すように
- Fix: オブジェクトストレージの設定でPrefixを設定していなかった場合nullまたは空文字になる問題を修正
- Fix: pgroongaでの検索時にはじめのキーワードのみが検索に使用される問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/886)
## 2025.2.0

View File

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