QOwnNotes
QOwnNotes copied to clipboard
[FEATURE] Allow ignore tildes and special characters on search
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?
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.
This is how the in-memory note table currently is created:
https://github.com/pbek/QOwnNotes/blob/253a9ab5f7f67b45e5a17ffcde5845f277c45dec/src/services/databaseservice.cpp#L421C25-L438
And this is one part of the search function:
https://github.com/pbek/QOwnNotes/blob/253a9ab5f7f67b45e5a17ffcde5845f277c45dec/src/entities/note.cpp#L852-L872
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 :/
One can register their own collating sequence.
Hm, even if that would work with Qt, I guess that might cause a lot of regressions.