I’m building a multilingual application with content in languages that use diacritics (Czech, French, etc.), and I need to implement search functionality that ignores accents/diacritics.
Current Situation:
-
Users can search blog posts by title and perex (excerpt)
-
I’m using
_icontainsfilter operator for case-insensitive search -
The search should match “cafe” with “café”, “Přemysl” with “Premysl”, etc.
Questions:
-
Is there a built-in filter operator in Directus that performs accent-insensitive search (similar to PostgreSQL’s
unaccentor MySQL’s collation)? -
What’s the recommended approach for this use case?
-
Should I store normalized versions of searchable fields?
-
Can I use custom database functions with Directus filters (i’m using Sqlite as storage)?
-
Is there a better pattern for multilingual search?
-
My current filter:
filter: {
_or: [
{ “title”: { “_icontains”: searchText } },
{ “perex”: { “_icontains”: searchText } }
]
}
Any guidance would be greatly appreciated!
Thank you