Using Azure Search with a hosted Ghost blog


Ghost is a powerful blogging engine known for its simplicity and speed. One thing it misses however is search. What if we could use the power of the cloud to allow readers to search on our blog?

From WordPress to Ghost

Recently I switched from a self-hosted WordPress blog to a hosted Ghost blog. The main reason for me was the fact that Ghost offers a service that they maintain. This allows me to focus on writing rather than maintaining the blog platform. Additionally I love the simplicity of writing in markdown and the speed of Ghost.

In contrary to WordPress, Ghost is a purely blogging platform. Comparing it to WordPress you will notice that there are some capabilities missing such as assets management or the ability to search on your blog.

Searching in Ghost

Currently Ghost doesn’t support searching in its contents natively. Some frequently used workarounds involve using Google Search or the Ghost Hunter plugin which uses the current RSS feed as its search index. As you can imagine, both solutions offer limited control about the search experience and results. Luckily there is a better way to implement search in Ghost.

Using Azure Search with a hosted Ghost blog

Recently a fellow MVP and a dear friend Paul Schaeflein wrote about using Azure Search with Ghost. He also moved over to Ghost recently and noticed the lack of search.

In his article Paul described the process of building a search index for Azure Search and filling it using the content from the Ghost export files and blog RSS feeds. Paul built his samples using C#, but since I’m on OS X, I wanted to have a solution that wouldn’t require me to run a VM.

I have built two node.js scripts: one that creates the search index in an Azure Search instance and one that fills that index with blog posts from a Ghost export file. Both scripts and additional information how you can use them are available on GitHub at https://github.com/waldekmastykarz/ghost-azure-search.

While using these scripts will require you to manually keep the search index up-to-date, it’s a good starting point for providing your readers with the ability to search in the contents of your blog.

Summary

Ghost is a great blogging platform. Unfortunately it lacks some capabilities such as search. Using Azure Search you can relatively easily provide your readers with an ability to search in the contents of your blog.

Others found also helpful: