Blog / Integrations

How to Build Powerful Search into Your Website with Algolia and a Headless CMS


by Petr Vozak

Sep 27, 2018

Implementing the perfect search that helps customers navigate to the right content as quickly as possible can be tough. But, don’t panic, it needn’t be difficult! Discover how to build powerful search into your website with Algolia and a headless CMS.

Defining what’s needed in a new website 

Before getting to a feature level, first ask yourself why you need a website. As we run through this article we’ll reflect on our own website story, which started in early 2017 when we decided to unify our product offering. Simply put, we merged several products into one. Of course, we had to align our product website with that – and by the way we did it one day

As our developers and marketers collaborated together to deliver the website, we decided there was no need for powerful search functionality at the very beginning as we only had a few blog posts. By committing to a headless approach, it meant that we didn’t have to define our future search requirements at the beginning and validate if it fit our Content Management System (CMS) capabilities. This is what we would probably have done, had we decided to go with traditional CMS. For us it was more important to know that there is always an option to extend website functionality, for example including proper search capabilities, if needed in the future. 

Headless CMS and microservices architecture – freedom and best-of-breed capabilities for everything 

It’s amazing what you can do differently with a light-weight microservices architecture - that’s why we chose a headless CMS. The beauty of headless CMS’s is that they don’t overwhelm you with tons of features you never use, complexity, and a difficult learning path. Instead they focus on what they do best – providing content as a service

On top of that, headless CMS provides great integration options to extend functionality if you need more. New cloud-based API services makes integration even easier. It’s totally up to you to choose a provider of requested functionality. And, you can change it in the future without too much effort, giving you all the flexibility you need. 

As for our website, we integrated Disqus for blog comments, MailChimp for newsletter subscriptions, and Google Analytics to analyze the traffic. The last decision we had to make was choosing the right search functionality that would fit our needs. And that is where another story starts… 

The time has come – let’s add search to our Blog 

As mentioned there was no search functionality at the very beginning, but when the number of articles increased, we wanted to make it easy for website visitors to consume the content they wanted. Having the website powered by a headless CMS gave us freedom of choice from multiple best of breed search service providers, including Algolia, Azure Search, Elastic, Swiftype, and others. 

We didn’t want to spend days or weeks researching and testing different search platforms – we wanted to get started quickly with something and adjust/replace in the future, if necessary. In general we favor an agile approach, and microservices architecture greatly supports that. 

Our key search engine requirements were as follows: 

  • Greatly fits our initial needs, i.e. full text search over our Blog section 
  • Fast and easy to integrate with our website and headless CMS 
  • High search performance (instant search, great typo tolerance etc.) 

We conducted some very brief research. We held a discussion with our internal team, asking them about their personal experience with different search engines, and checked some online reviews and comparisons like stackshare.io. After one day (yes, we time boxed this exercise) we ended up with Algolia

Current full-text search experience on our website powered by Algolia

I am sure you will need spend more time on research if you have more sophisticated requirements. If your requirements are similar to ours, or you're looking for something more complex, explore Algolia, as it provides all the search and discovery capabilities you may need, including Standard search, Voice search, Analytics, A/B testing, Query rules and more. 

Fast and painless integration 

It took us only one day to connect the headless CMS and Algolia and create a search experience on our website. The ease-of-integration and intuitive search configuration was fantastic. It mostly centered on these three steps:

  1. Index existing blog posts on Algolia 
  2. Ensure indexing when data changes (using a webhook) 
  3. Search through the index and display results (when web visitors submit a query) 

A scheme describing how the integration works


If you're interested in more technical details, you can read a deep-dive article about how we connected content and search services together to create an appealing search experience on our website

Thank you Kentico Cloud and Algolia 

Now you should have a better understanding of the possibilities in the world of specialized microservices:

  • Freedom of choice from best of breed services 
  • Microservices architecture greatly supports an agile approach – start small and add new service or replace one, if needed 
  • An example of how you can connect Kentico Cloud (a headless CMS, content-as-a-service) and Algolia (search-as-as-service) 

We tested it, and clearly reaped the rewards when we implemented our website, and now our visitors have a better search experience.
 

Why not give microservices architecture a try? If it's something you're interested in, get your hands on a free 30-day trial of Kentico Cloud, choose a small project to test it with, and you will be surprised at how powerful it can be.