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

Search filter is case sensitive for non ASCII characters #5102

Open
JackGruber opened this issue Jun 19, 2021 · 3 comments
Open

Search filter is case sensitive for non ASCII characters #5102

JackGruber opened this issue Jun 19, 2021 · 3 comments
Labels
backlog We'll get to it... eventually... bug It's a bug search

Comments

@JackGruber
Copy link
Contributor

When you have tags/notebooks with mixed case and a non ASCII char is uppercase/lowercase you can't search for them with the wrong case in the search filter.

Affected filter:

  • tag
  • notebook

Environment

Joplin 2.1.0 (dev, win32)

Sync Version: 2
Profile Version: 39
Keychain Supported: Yes

Steps to reproduce

Tag

  1. Import Notes with mixedcase or upper case tags like AÜW
  2. Search: tag:aüw = no search results
  3. Search: tag:aÜw = search results

Notebook

  1. Create a notebook AÜW
  2. Create some notes in the notebook
  3. Search: notebook:aüw = no search results
  4. Search: notebook:aÜw = search results

Describe what you expected to happen

You can filter even if you don't know the exact casing.

More info

(18) Case-insensitive matching of Unicode characters does not work.
https://www.sqlite.org/faq.html#q18

SQL Example:
SELECT LOWER('MY TEST STRING with non ASCII ÜÄÖÉ ...') AS test;

test
my test string with non ascii char ÜÄÖÉ ...

One possible solution would be to overload the default LOWER() function.

@JackGruber JackGruber added the bug It's a bug label Jun 19, 2021
@laurent22
Copy link
Owner

In the normalizeText function of the search engine, I see the diacritics are already removed so in theory it should work. But maybe for some reason certain letters aren't processed properly.

@laurent22 laurent22 added high High priority issues search labels Jun 20, 2021
@JackGruber
Copy link
Contributor Author

Tags and notebook filter directly on the tags and folder table with LIKE.
If I see it correctly, only the note text is normalised.

@laurent22
Copy link
Owner

Good point. That might be trickier than I thought then as if we can't use the LOWER function, it means we need to normalize folder and tag titles in a separate table too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We'll get to it... eventually... bug It's a bug search
Projects
None yet
Development

No branches or pull requests

2 participants