Problem: Dutch Bible language has many morphological variations. Searching for "liefde" (love) won't find "liefhebben" (to love) or "bemind" (beloved) because FTS5 stemming doesn't handle Dutch well. Users miss relevant results.
Solution: A hand-curated dictionary of 14 key Bible terms mapped to their morphological variants. When a user searches in Dutch, known terms are automatically expanded into FTS5 OR groups covering all related word forms.
Not included: Automatic stemming, fuzzy matching, or typo correction. Only the 14 predefined term families are expanded.
When searching in Dutch, the system automatically expands known Bible terms to include related word forms.
Example: Searching "liefde" actually searches: (liefde* OR liefheb* OR bemin* OR lieflijk*)
14 covered term families: liefde (love), geloof (faith), zonde (sin), gebed (prayer), genade (grace), hoop (hope), vrede (peace), waarheid (truth), rechtvaardig (righteous), verlossing (redemption), heilig (holy), dood (death), opstanding (resurrection), koninkrijk (kingdom)
Edge cases:
word*key.startsWith(word) || word.startsWith(key)Invisible to the user — expansion happens server-side. Users just type their query and get better results.
TODO: Show "Also searching for: [expanded terms]" in the UI when expansion occurs.
Dictionary (dutch-synonyms.ts):
DUTCH_SYNONYMS = {
liefde: ['liefde*', 'liefheb*', 'bemin*', 'lieflijk*'],
geloof: ['geloof*', 'gelov*', 'vertrouw*'],
// ... 12 more
}
expandDutchQuery(query):
(syn1 OR syn2 OR ...)word* (prefix)Integration: Called from searchVerses() when lang === 'nl'.
Files:
apps/web/src/lib/server/queries/dutch-synonyms.ts — dictionary + expansion functionapps/web/src/lib/server/queries/search.ts — calls expandDutchQuery() for Dutch searchesCurrent: IN_PROGRESS Milestone: Foundation Priority: Medium — significantly improves Dutch search quality
What's done:
What remains:
Dependencies: