QOwnNotes icon indicating copy to clipboard operation
QOwnNotes copied to clipboard

[FEATURE] Allow ignore tildes and special characters on search

Open nico2sh opened this issue 1 year ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe.

It would be great to be able to search ignoring tildes, when I search both in the search box and in a script, I have to type exactly how it was written (ignoring uppercase though), so if I'm looking for something like:

Avion means plane in Spanish

I get zero results if the actual text is

Avión means plane in Spanish

Describe the solution you'd like

In search, use these character mappings for example:

  • á=a
  • é=e
  • í=i
  • ó=o
  • ú=u
  • ñ=n
  • ç=c ...more?

nico2sh avatar Oct 10 '24 08:10 nico2sh

This looks like a sqlite collate question. I guess someone would need to research and then try how this could be achieved with sqlite and Qt.

pbek avatar Oct 10 '24 09:10 pbek

This is how the in-memory note table currently is created:

https://github.com/pbek/QOwnNotes/blob/253a9ab5f7f67b45e5a17ffcde5845f277c45dec/src/services/databaseservice.cpp#L421C25-L438

pbek avatar Oct 10 '24 09:10 pbek

And this is one part of the search function:

https://github.com/pbek/QOwnNotes/blob/253a9ab5f7f67b45e5a17ffcde5845f277c45dec/src/entities/note.cpp#L852-L872

pbek avatar Oct 10 '24 09:10 pbek

Thanks for pointing out to the right direction. From the sqlite docs, no case unicode characters search is not supported but the NOCASE collation can be overriden. One can register their own collating sequence. My C++ is very rusty to figure out if that or how that can be done :/

nico2sh avatar Oct 11 '24 06:10 nico2sh

One can register their own collating sequence.

Hm, even if that would work with Qt, I guess that might cause a lot of regressions.

pbek avatar Oct 11 '24 06:10 pbek