I wrote this after repeatedly handling MySQL FULLTEXT search with fallbacks on client projects. Not every project needs Elasticsearch. I share how I build useful search with MySQL FULLTEXT plus sensible fallbacks.
Start Simple, Measure Search Quality
Not every project needs Elasticsearch. I share how I build useful search with MySQL FULLTEXT plus sensible fallbacks.
- FULLTEXT indexes — applied directly to MySQL FULLTEXT search with fallbacks.
- LIKE fallback — applied directly to MySQL FULLTEXT search with fallbacks.
- relevance ordering — applied directly to MySQL FULLTEXT search with fallbacks.
- query sanitisation — applied directly to MySQL FULLTEXT search with fallbacks.
Putting It Together
The working version of Building Search With MySQL FULLTEXT and Fallbacks centred on FULLTEXT indexes, LIKE fallback, relevance ordering, and query sanitisation. I avoided copying patterns from other modules unless they solved a problem this feature actually had.
Plan Upgrade Path If Volume Grows
Representative code from the implementation — simplified for readability, but structurally what I deploy.
Cursor pagination for large MySQL tables
SELECT id, news_title, published_date
FROM news
WHERE status = 'Published' AND id < :cursor_id
ORDER BY id DESC
LIMIT 20;
CREATE INDEX idx_news_status_id ON news (status, id);What I Would Do Again on This Topic
Shipping MySQL FULLTEXT search with fallbacks cleanly meant the next developer could extend it without untangling hidden coupling.
If I repeated this, I would write the regression checks earlier — especially around the failure paths users hit once, not the happy path.
Where I Would Begin Again
- Start with the exact problem statement for MySQL FULLTEXT search with fallbacks — one sentence, no buzzwords.
- Prioritise FULLTEXT indexes before polishing secondary UI details.
- Validate LIKE fallback under realistic data volume, not demo rows.