Skip to content

fix: support diacritic-insensitive search indexing closes (#629)#749

Merged
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
itzabdoull:fix-search-diacritics
Jun 30, 2026
Merged

fix: support diacritic-insensitive search indexing closes (#629)#749
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
itzabdoull:fix-search-diacritics

Conversation

@itzabdoull

@itzabdoull itzabdoull commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Closes #629


Description
This PR resolves issue #629 where search queries containing or targeting courses containing Unicode diacritics (accents/umlauts/etc.) were not matching. For example, searching for "cafe" now successfully returns courses titled "Café Communication", and "resume" finds "Résumé Writing".

Key Changes
New Utility Function: Added

normalizeText
in src/utils/stringUtils.ts to convert text into Unicode NFD form and strip out all diacritical marks via regex (normalize('NFD').replace(/[\u0300-\u036f]/g, '')).
Normalized Indexing (Index-Build Time): Integrated normalizeText into the course indexing pipeline in

searchIndex.ts
for:
Course title tokens and individual word suggestions.
Course category tokens.
Instructor name tokens.
Cap-sliced course description tokens.
Note: Original display text in documents is preserved unchanged so the user interface renders unmodified characters (e.g., 'Café').
Normalized Query Matching (Query Time): Normalized the user query string in the search function before tokenization and prefix matching.
Unit Tests: Added

searchIndex.test.ts
covering matches for:
'Café' → 'cafe'
'Résumé' → 'resume'
'München' → 'munchen'
'Ñoño' → 'nono'
Verification
Run npx jest tests/services/searchIndex.test.ts (All 4 unit tests pass)
Run npx jest tests/services/searchIndex.perf.test.ts (Validates execution meets the 50ms index query budget)

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@itzabdoull Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER RUKAYAT-CODER merged commit b5f7e3d into rinafcode:main Jun 30, 2026
2 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] searchIndex does not handle diacritics — 'Café' not found when searching 'Cafe'

2 participants