fix(backend): pgroongaでの検索時にはじめのキーワード以外が検索に使用されない問題を修正 (#15496)
* fix pgroona note.text query * Update Changelog --------- Co-authored-by: Hazelnoot <acomputerdog@gmail.com>
This commit is contained in:
parent
9611bfbbf7
commit
88900492a4
|
@ -20,6 +20,8 @@
|
||||||
### Server
|
### Server
|
||||||
- Fix: `following/invalidate`でフォロワーを解除しようとしているユーザーの情報を返すように
|
- Fix: `following/invalidate`でフォロワーを解除しようとしているユーザーの情報を返すように
|
||||||
- Fix: オブジェクトストレージの設定でPrefixを設定していなかった場合nullまたは空文字になる問題を修正
|
- Fix: オブジェクトストレージの設定でPrefixを設定していなかった場合nullまたは空文字になる問題を修正
|
||||||
|
- Fix: pgroongaでの検索時にはじめのキーワードのみが検索に使用される問題を修正
|
||||||
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/886)
|
||||||
|
|
||||||
|
|
||||||
## 2025.2.0
|
## 2025.2.0
|
||||||
|
|
|
@ -220,7 +220,7 @@ export class SearchService {
|
||||||
.leftJoinAndSelect('renote.user', 'renoteUser');
|
.leftJoinAndSelect('renote.user', 'renoteUser');
|
||||||
|
|
||||||
if (this.config.fulltextSearch?.provider === 'sqlPgroonga') {
|
if (this.config.fulltextSearch?.provider === 'sqlPgroonga') {
|
||||||
query.andWhere('note.text &@ :q', { q });
|
query.andWhere('note.text &@~ :q', { q });
|
||||||
} else {
|
} else {
|
||||||
query.andWhere('LOWER(note.text) LIKE :q', { q: `%${ sqlLikeEscape(q.toLowerCase()) }%` });
|
query.andWhere('LOWER(note.text) LIKE :q', { q: `%${ sqlLikeEscape(q.toLowerCase()) }%` });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue