A few weeks ago, one of my customers reached out looking for full-text search capabilities for their Ghost site. They mentioned Algolia, which I hadn’t worked with before, so I decided to dive in and experiment.
Algolia worked well with Ghost - the toolkit the Ghost team provides does its job. But as I implemented it, I realized the setup process is quite technical. And whenever something’s overly complicated, I have the urge to make it easier.
My first thought was to integrate Algolia directly into Magic Pages as a feature. But there was a problem: since Algolia is proprietary software, customers would still need to create and manage separate Algolia accounts. That’s friction I wanted to eliminate.
After about a week of research, I discovered Typesense - an excellent open source alternative to Algolia with similar capabilities and simpler implementation.
This changed my approach: instead of just adding Algolia support, I could build a complete Typesense integration for Magic Pages as a one-click feature (which is coming soon: https://www.magicpages.co/roadmap/better-search-on-pro-plans/ ).
But what’s an open source search without well…open sourcing it. This is something every Ghost site could benefit from, no matter where it’s hosted.
Today I’m releasing ghost-typesense on GitHub, to make this possible. This toolkit provides everything needed to power up your Ghost site’s search capabilities:
- A beautiful search UI (with dark mode detection and a manual override)
- Full-text search (and the ability to customise searchable fields)
- A command-line tool to easily sync your content, similar to the Ghost team’s Algolia CLI
- A webhook handler for keeping search results updated in real-time (with the ability to deploy it on Netlify, again, similar to the Ghost team’s Algolia implementation)
You can see it live in action on Magic Pages and my personal blog.
Why should you use this?
Ghost’s default sodo-search
only looks at titles, excerpts, tags and authors. This works great for most sites. But, as your site grows, you might want to give people the opportunity to look for keywords that are embedded deep in your post content.
This Typesense integration enables this.
So far, Algolia has been the standard recommendation for advanced search in Ghost. And hey, it’s a great service, but it can get expensive as your site grows, and is closed-source proprietary software.
Typesense provides comparable search capabilities but as fully open source software. You can either self-host it (free) or use Typesense Cloud if you prefer a managed solution.
The GitHub repo contains complete documentation for implementing this on any Ghost site, regardless of where you host.
Would love to hear your thoughts on this and any suggestions for improvements (specifically on the search UI - trying to strike a balance between beautiful, yet not too opinionated).