Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Case-insensitive search for non-ASCII messages (#5052) #5321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Mar 5, 2024

SQLite search with LIKE is case-insensitive only for ASCII chars. To make it case-insensitive for all messages, create a new column msgs.txt_normalized defaulting to NULL (so we do not bump up the database size in a migration) and storing lowercased/normalized text there when the row is created/updated. When doing a search, search over IFNULL(txt_normalized, txt).

Close #5052

src/message.rs Outdated Show resolved Hide resolved
@iequidoo iequidoo marked this pull request as ready for review March 5, 2024 02:39
@iequidoo iequidoo requested review from link2xt and r10s March 5, 2024 02:40
@link2xt
Copy link
Collaborator

link2xt commented Apr 20, 2024

Let's merge this after merging peerchannels. @Simon-Laux is running peerchannels PR with current account without a backup AFAIK, so rebasing peerchannel migration on top of this migration will cause troubles.

@link2xt
Copy link
Collaborator

link2xt commented May 19, 2024

Peerchannels are merged, so this needs a rebase now.

SQLite search with `LIKE` is case-insensitive only for ASCII chars. To make it case-insensitive for
all messages, create a new column `msgs.txt_normalized` defaulting to `NULL` (so we do not bump up
the database size in a migration) and storing lowercased/normalized text there when the row is
created/updated. When doing a search, search over `IFNULL(txt_normalized, txt)`.
@iequidoo iequidoo force-pushed the iequidoo/case-insensitive-search branch from 079394d to e38e21d Compare May 20, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search is case sensitive for non-ASCII messages
2 participants