Implementing Lightning-Fast Algolia Search On A Magento Site


At Spiral Media, we’re obsessed with delivering the highest performing Magento sites for our clients.

Sure, it’s great to have a well-designed site that looks amazing and gets people talking (that’s exactly what we aim for!).

But in order to keep website visitors happy and converting into customers, we need to give those users a great experience while browsing through the site.

We’re already implementing industry best-practices, and feel we’re leading in our field when it comes to web performance optimisation.

However, there’s always room for improvement, and one aspect we’ve always wanted to improve upon was the speed of search auto-complete.

We serve client Magento sites from a powerful, SSD-backed server located in the UK, which gives lightning-fast access times for databases, yet even with additional optimisation it still takes a few seconds to display real-time results in the auto-complete drop-down.

Investigating Algolia

So a few months back, while looking through one of my favourite sites – Product Hunt, I noticed they were using Algolia for their search functionality. Though not an eCommerce company, they’re known for adopting and promoting the latest web technology, so I thought I’d take a deeper look.

After looking into the service more, I found that they had a number of large eCommerce clients using their platform, and looking at their Magento demo there was no question that we should at least try this on a development site.

We chose Little Women, a client who sells a selection of bras and lingerie. As with standard development workflow, we initially implemented it on a development sub-domain for testing purposes.

This was so as not to affect the live site, and also so we could do a like-for-like comparison to show the client before proposing that we roll it out to their live site.

Algolia have a free plan which supports sites with up to 10k products, and 100k monthly queries. Above that, pricing starts at $49/mo for 100k products and 1m monthly queries.

Comparing Algolia with default Magento search

Default Magento Search:

Algolia Search:

Note, the Algolia recording above was done before the drop-down was styled. Here’s how it looks on the live site today.

Algolia Analytics

Once you’ve implemented Algolia, you can get access to detailed statistics on things such as the most popular search queries, along with some advanced features such as blocking use of the search to specific IP addresses. For example, if you’ve got a bot running 1,000s of searches it’ll be eating through your free/paid allowance.

Algolia Analytics search queries

We’re also looking at integrating this with the site search section of Google Analytics (Behaviour > Site Search) in the near future.

Algolia’s Distributed Search Network

During the sign-up process, you’re able to select a single location where your database should be hosted. This should be where most of your website visitors are located.

As you can see below, we’re getting <10ms response times for UK visitors from one of their European datacentres, which is incredibly fast.

Little Women also get a fair amount of traffic from the US. While the response time is slower than for UK-based visitors, it’s only ~0.1 seconds – which will still be perceived as ‘fast’ by website visitors.

Algolia Distributed Search Network map

So all in all, a great product we’ll be looking to roll out to new and existing Magento clients.

It vastly improves upon the default search, and also has the benefit of reducing server load.

If you’d like us to help with the implementation of Algolia search on your Magento site, or anything else, feel free to get in touch.