Skip to content

pg_bigmが利用できるよう、ノートの検索をILIKE演算子でなくLIKE演算子でLOWER()をかけたテキストに対して行うように - #15205

Merged
mi-gh-maintainer[bot] merged 2 commits into
misskey-dev:developfrom
yuba:feature/like-lower
Jan 4, 2025

Conversation

@yuba

@yuba yuba commented Jan 3, 2025

Copy link
Copy Markdown
Contributor

What

ノート検索はnote.textに対してILIKE演算子で %検索ワード% をマッチさせており、これで大小文字を同一視した検索をしています。
これを、LOWER(note.text)に対してLIKE演算子で %小文字化した検索ワード% を使うように変更し、動作は変えずにILIKE演算子を不使用にしています。

Why

  • 日本語にも対応した高速全文検索拡張のpg_bigmがLIKE演算子のみに対応しており、ILIKE演算子には非対応のためです
  • StackOverflowでの問答のみがソースですが、インデックスのない状態ではLOWER-LIKEのほうがILIKEよりもパフォーマンス上もやや分がありそうです https://stackoverflow.com/questions/20336665/lower-like-vs-ilike

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions Bot added the packages/backend Server side specific issue/PR label Jan 3, 2025
@github-actions

github-actions Bot commented Jan 3, 2025

Copy link
Copy Markdown
Contributor

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

@codecov

codecov Bot commented Jan 3, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 40.00%. Comparing base (3c81926) to head (1ea1dda).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/SearchService.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #15205      +/-   ##
===========================================
+ Coverage    39.96%   40.00%   +0.04%     
===========================================
  Files         1563     1563              
  Lines       197878   197878              
  Branches      3646     3664      +18     
===========================================
+ Hits         79080    79168      +88     
+ Misses      118193   118137      -56     
+ Partials       605      573      -32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mi-gh-maintainer
mi-gh-maintainer Bot merged commit 79b3d2a into misskey-dev:develop Jan 4, 2025
@mi-gh-maintainer

Copy link
Copy Markdown

Thank you 🙏

ruruke pushed a commit to ruruke/rukey-legacy that referenced this pull request Jan 4, 2025
…isskey-dev#15205)

* Use LIKE-LOWER instead of ILIKE, which pg_bigm doesn't support.

* changelog: Enhance: pg_bigmが利用できるよう、ノートの検索をILIKE演算子でなくLIKE演算子でLOWER()をかけたテキストに対して行うように
kanarikanaru added a commit to HanaMisskey/misskey that referenced this pull request Jan 7, 2025
* 2025 (misskey-dev#15203)

* enhance(frontend): ワードミュート・ハードワードミュートの説明を追加 (misskey-dev#15207)

* pg_bigmが利用できるよう、ノートの検索をILIKE演算子でなくLIKE演算子でLOWER()をかけたテキストに対して行うように (misskey-dev#15205)

* Use LIKE-LOWER instead of ILIKE, which pg_bigm doesn't support.

* changelog: Enhance: pg_bigmが利用できるよう、ノートの検索をILIKE演算子でなくLIKE演算子でLOWER()をかけたテキストに対して行うように

* fix(frontend/AiScript): Ui:C:selectの値が切り替わらない問題を修正 (misskey-dev#15184)

* fix(frontend/AiScript): Ui:C:selectの値が切り替わらない問題を修正

* Update Changelog

* fix(backend): アプリ作成方式で作成したトークンの権限を表示するように (misskey-dev#15177)

* fix(frontend): MiAuth認可画面で、認可処理に失敗した場合でもコールバックURLに遷移してしまう問題を修正 (misskey-dev#15154)

* feat(MiAuth): アクセストークンの発行に失敗した場合コールバックに遷移しないようにする (MisskeyIO#831)

Cherry-picked from TeamNijimiss/misskey@8003596

Co-authored-by: nafu-at <satsuki@nafusoft.dev>

* Update Changelog

* Update Changelog

---------

Co-authored-by: あわわわとーにゅ <17376330+u1-liquid@users.noreply.github.com>
Co-authored-by: nafu-at <satsuki@nafusoft.dev>

* Chore: Docker内のDebianのバージョンを上げる(bookworm) (misskey-dev#15073)

* fix(frontend): ノート検索が使用できない場合でもチャンネルのノート検索欄がでていた問題を修正 (misskey-dev#15082)

* fix(frontend): ノート検索が使用できない場合でもチャンネルのノート検索欄がでていた問題を修正

* Update Changelog

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

* enhance(frontend/aiscript): セーブ内容を削除できるMk:removeを追加 (misskey-dev#15158)

* enhance(frontend/aiscript): セーブ内容を削除できる`Mk:remove`を追加

* fix

* Update Changelog

* fix(frontend): ファイルの添付可能数を超えたらノートボタンを押せないように (misskey-dev#15126)

* fix(frontend): ファイルの添付可能数を超えたらノートボタンを押せないように

* Update Changelog

* Update MkPostForm.vue

* fix(frontend): アカウント一覧画面で、ユーザー情報の取得に失敗したアカウントが表示されない問題を修正 (misskey-dev#15183)

* fix(frontend): アカウント一覧画面で、ユーザー情報の取得に失敗したアカウントが表示されない問題を修正

* Update Changelog

* 🎨

* [ci skip] Update CHANGELOG.md (書き方を揃える)

---------

Co-authored-by: Yuba <m.takuma@gmail.com>
Co-authored-by: 4ster1sk <146138447+4ster1sk@users.noreply.github.com>
Co-authored-by: あわわわとーにゅ <17376330+u1-liquid@users.noreply.github.com>
Co-authored-by: nafu-at <satsuki@nafusoft.dev>
Co-authored-by: KanariKanaru <93921745+kanarikanaru@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/backend Server side specific issue/PR

Projects

Development

Successfully merging this pull request may close these issues.

1 participant