-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 to accents not working with sqlite #18429
Comments
Hmm, SQLite is here wrong it seems. We are currently upper casing all characters of the keyword(to avoid case sensitive searches). Go is handling uppering accent characters: https://go.dev/play/p/MBiTQq-3mAl, however SQLite only supports uppering ASCII characters: And thus these 2 will never match each other... I think the best option is to have a special ToUpper function for SQLite that only uppers ASCII strings and thus match SQLite's specs. |
Likely we should be letting the DB do the UPPER() and not expecting the go collation to be the same as the db. (I would also note that we should probably be considering unicode normalizing the strings... For example, ë and ë are not the same character.) |
@zeripath Unless I'm misunderstanding something, but it doesn't seem like we can use the UPPER function for provided values(as in, the values for ?): |
- Use `ToASCIIUpper` for SQLite database on issues search, this because `UPPER(x)` on SQLite only transforms ASCII letters. - Resolves go-gitea#18429
Use `ToASCIIUpper` for SQLite database on issues search, this because `UPPER(x)` on SQLite only transforms ASCII letters. Resolves #18429
Use `ToASCIIUpper` for SQLite database on issues search, this because `UPPER(x)` on SQLite only transforms ASCII letters. Resolves go-gitea#18429
Gitea Version
1.15.10
Git Version
git version 2.30.2
Operating System
Alpine Linux 3.13.7
How are you running Gitea?
Official docker image deployed with docker-compose:
Database
SQLite
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
I use a custom indexer setting to search for word fragments as well.
But unfortunately, accented search doesn't work without this option. (neither in the title nor in the content)
I have another gitea system installed with a postgesql database engine, the accented search works correctly there, so i think sqlite is the cause of the malfunction.
Is there any sqlite specific language option I should set?
Screenshots
Without search:
With accent search:
With accent free search:
The text was updated successfully, but these errors were encountered: