Django admin search treating latin letters as lithuanian letters
There are several non-Latin letters in Lithuanian, and all of them can be written as Latin:
± - a, č - c, ę / é - e, į - i, š - s, ø / ū - u, ž - z.
For example, the database contains records ąžuolas
and azuolas
. If I type a query into django admin ąžuolas
, then it finds both entries. If azuolas
- only the second.
What do I need to change in django (or MySQL) to make it work both ways?
source to share
First of all, I just learned that those characters that look like Latin have a common name: Diacritics !
Django seems to resolve this type of query using full text search (it has been confirmed to be successful in this comment on a related question
Woooa check this little switch here !!
elif field_name.startswith('@'):
return "%s__search" % field_name[1:]
Could it be that when @azuolas
you find , you will finally find ąžuolas
? Please try and report your results.
Also, here's a link to the MySQL article in BOOLEAN MODE
source to share