Skip to content

Commit

Permalink
fix(backend): pgroongaでの検索時にはじめのキーワード以外が検索に使用されない問題を修正 (#15496)
Browse files Browse the repository at this point in the history
* fix pgroona note.text query

* Update Changelog

---------

Co-authored-by: Hazelnoot <acomputerdog@gmail.com>
  • Loading branch information
kakkokari-gtyih and warriordog authored Feb 15, 2025
1 parent 9611bfb commit 8890049
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) }%` });
}
Expand Down

0 comments on commit 8890049

Please sign in to comment.