Designing a Better Baby Name Search: What I Learned About Search UX, Unicode, and Relevance
说明与用途
构建有效的宝宝姓名搜索系统需要结构化数据、Unicode规范化、基于相关性的排名和可解释的结果,使用户能够快速找到所需姓名,避免额外的努力。
问题
A baby-name database requires more than CRUD; users search by meaning, alternate spellings, cultural origin, and sound, not exact spelling, making simple text search inadequate.
结果
The redesigned search architecture improved relevance, reduced noise, and enhanced user trust by preserving original data, applying proper Unicode handling, and providing explainable results, turning a simple CRUD app into a sophisticated search product.
工作流
- Define a document schema with name, normalizedName, gender, meanings, origins, religions, alternateSpellings, countries.
- Normalize names using String.prototype.normalize("NFKD") and diacritic removal for search fields.
- Implement MongoDB Search with relevance scoring: exact match > normalized match > prefix > alternate spelling > meaning.
- Add autocomplete operator for as-you-type suggestions, limiting to top 5 relevant results.
- Design structured filters (gender, origin, religion, meaning, country, style, popularity, zodiac) based on user questions, not raw columns.
- Ensure original spelling is preserved for display; use separate search value for matching.
- Provide explainable ranking in UI (e.g., "Turkish origin · "moonlight" · Girl").
- Avoid collecting unnecessary personal data; keep search input transient.
- Measure failed searches and iterate on relevance.
- Test with real spelling variations and multilingual input.
证据
The first mistake is treating a baby name as a single string.
JavaScript's String.prototype.normalize() exists specifically to deal with these different Unicode representations.
MongoDB Search provides tools specifically for relevance-oriented search, including autocomplete, compound queries, filtering, faceting, and scoring.
- 记录日期: 2026-09-22T13:30:55.516Z