Do you ignore accented words in your django query

Did you know that a normal search for "Helen" will usually miss names like "Hélène"? By default, icontains only matches exact characters, so accents or diacritics can make your search feel broken to users. On PostgreSQL, using the unaccent lookup fixes this: Author.objects.filter(nameunaccenticontains="Helen") Now your search finds "Helen", "Helena", and "Hélène", making your app truly international-friendly. Don't forget to include "django.contrib.postgres" in your installed apps and enable UnaccentExtension in django migrations or using SQL (CREATE EXTENSION "unaccent";)

submitted by /u/natanasrat
[link] [comments]