I found alot of answers about collation and accent insensitive search, read like 1000 of posts and articles about this problem, but did not find the answer.
Does anybody know how to force mysql to search accent insensitive with ALL polish characters? Maybe anybody got a compiled collation file for that (Debian)?
Please note, that:
- Setting collation to
utf8_general_ci
does not help. It does not supportŁ
properly. But it does ruin search order. - Setting collation to
utf8_unicode_ci
does not help. Same as above. - Editing collation files is not possible because it is multibyte encoding. And multibyte charsets have to be compiled.
- Replacing all unsupported letters to supported ones is not a solution.
I really don't understand why MySQL crew doesn't threat this as a bug. It's obvious, that it is, and it has been for ages. Since 4.xx they did correct Ś
letter... so why not Ł
?!
I found some references to This MySQL functionality, but no information on how to use it. I don't really understand what is being written there and if it can help me.
Tests:
mysql> show full columns from test;
+-------+--------------+----------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+--------------+----------------+------+-----+---------+-------+---------------------------------+---------+
| str | varchar(255) | utf8_polish_ci | YES | | NULL | | select,insert,update,references | |
+-------+--------------+----------------+------+-----+---------+-------+---------------------------------+---------+
mysql> insert into test values('Łomża');
...
mysql> select str from test where str like '%Łomża%'\G
*************************** 1. row ***************************
str: Łomża
mysql> select str from test where str like '%Łomza%'\G
Empty set (0.00 sec)
--
mysql> select str from test where str like '%Łomza%' collate utf8_general_ci\G
*************************** 1. row ***************************
str: Łomża
mysql> select str from test where str like '%Lomza%' collate utf8_general_ci\G
Empty set (0.00 sec)
--
mysql> select str from test where str like '%Łomza%' collate utf8_unicode_ci\G
*************************** 1. row ***************************
str: Łomża
mysql> select str from test where str like '%Lomza%' collate utf8_unicode_ci\G
Empty set (0.00 sec)