main ← fix/unaccent-category-search
opened 05:55PM - 07 Feb 26 UTC
Categories with accented names (e.g. "Éditions") were not appearing in search re…sults, category chooser dropdowns, or hashtag autocomplete when searching with unaccented terms (e.g. "editions").
PostgreSQL's `ILIKE` and `LOWER()` are case-insensitive but not accent-insensitive, so queries like `name ILIKE '%editions%'` would not match "Éditions".
This wraps all category name/slug comparisons with PostgreSQL's `unaccent()` function across:
- `/categories/search` endpoint
- `/categories/hierarchical_search` endpoint
- Hashtag (#) autocomplete
- `category:` and `#slug` search filters
On the frontend, adds a shared `removeAccents()` utility using NFD normalization for client-side `Category.search()` and search filter suggestions.
Ref - https://meta.discourse.org/t/395355