Algolia - Make Every Search Strategic

Algolia - Make Every Search Strategic

Saurabh Suryavanshi's photo
Saurabh Suryavanshi
·Jan 5, 2021·

6 min read

Play this article

While working over different projects and a few e-commerce applications which are built on top of the database, the problem that I experienced is that none of the most used databases (MySQL or a NoSQL database like MongoDB) provide a full, satisfying search functionality with minimum query and time frame.

Considering the above scenario, in this article, we will take our discussion forward by addressing the following question:

Why we shifted to Algolia?

Comparing it with other traditional and modern searching techniques, the pros, the cons and all the performance benefits we have achieved after we use it in our real-world e-commerce application are far more beneficial.

Traditional Relational Databases Like MySQL.

Earlier, MySQL does provide the LIKE operand to perform the search functionality and later with the new version of MySQL, they have added a new feature for search that is Natural Language Full-Text Searches. In this section, we will discuss MySQL Full-Text Searches and it's limitations.

Full-Text Search in MySQL server lets users run full-text queries against character-based data in MySQL tables. You must create a full-text index on the table before you run full-text queries on a table. The full-text index can include one or more character-based columns in the table. On a quick look, it seems okay to use the above search feature but its limitations list is bigger than its features list.

I have put together its limitations, which I figured out while working over it and those can not be ignored if you can’t compromise with the performance and productivity of your application.

  • Searches are not case sensitive.
  • The selection of 'word characters' doesn't meet your needs always, and it's tricky to change. For example, searching for "Ant" won't match "Ant's". In general, there is no support for any kind of stemming, so "apple" won't match "apples" either.
  • Words called stopwords are ignored. You can specify your own stopwords, but default words include the, have, some - see default stopwords list.
  • The MATCH () column list must match exactly the column list in some FULLTEXT index definition for the table, unless this MATCH () is IN BOOLEAN MODE on a MyISAM table. For MyISAM tables, boolean-mode searches can be done on non-indexed columns, although they are likely to be slow.
  • Full Text searching is only supported by the MyISAM storage engine.
  • Full-text searches are not supported for partitioned tables.
  • If a word is present in more than 50% of the rows it will have a weight of zero. This has advantages on large datasets but can make testing difficult on small ones.

You can also refer to MySQL documentation 12.10.5 Full-Text Restrictions

Above are the reasons why we can’t rely on MySQL only to handle our application search functionality, which not only compromises the performance of the application but also risks the quality of user experience.

So, our search to find better search functionality still continuous and we came up with two new modern solutions which can fulfill all search-related query and expectations and those are Algolia and ElasticSearch.

Algolia VS ElasticSearch: Who Will Win?

Until now, both of the platforms provide a wide range of functionality and features which are almost common but there is some difference which makes one superior over another.

In the section below, we sum up our findings, perform some raw tests and compare the user experience offered by both of them.

Over 2 Million Record Testing

The results and benchmarks score of the test performed using the database of around 2M products to measure the performance of both search services speaks volumes about its efficiency. By keeping everything else constant and not limiting the test to a crude keyword search but aimed at building a first-class user experience, returning instant results after each keystroke, factoring popularity in the ranking and tolerating user mistakes, the query vs time table is generated below, which displays Algolia to be around 20 to 200 times faster than Elasticsearch.

Screenshot 2020-12-22 at 11.23.46 AM.png

The above score can definitely make Algolia superior to Elasticsearch in terms of performance but we can not consider the performance only, as user experience is also an important point to consider. We just can’t serve the end-user the quickest result but the results which they are looking for in the quickest possible time.

User Experience

Most of the time, users want to work with a GUI that is easy to use and understand. Algolia does have its own GUI for a better user experience. It offers front-end widgets along with APIs and has a dashboard with several filters, which makes it a better human-machine interface when compared to others. You can configure them to view user behavior/history or any data in a simplified manner.

Elasticsearch, on the other hand, does not have its own GUI. You have to install Kibana for data visualization or add an extension to your browser to interact with it.


Algolia has a hosted SaaS option which handles the storage of all data and hosting of the indexing system. Algolia is not a database, it is a hosted search engine accessible through an API.

Elasticsearch is a search engine that is self-hosted on a server you own. Therefore, it has the ability to set up the system exactly how you want. But it comes with the problem of security and permission, which is a huge drawback.

Out-of-the-box features of Algolia

Algolia provides so many built-in features that can be easily configured and integrated into any search implementation, and don’t require any extra development.

Here are some of them which can improve your overall search strategy:


Algolia provides a strong typo-tolerance feature, along with easy ways to customize just how tolerant a search experience should be.


Faceting is a common search feature that Algolia provides out of the box. Facets let you create categories for a select group of attributes, so end users can refine their search.

Multiple Sorting Strategies

You can set up multiple sorting strategies to help users select their preferred ranking. Like sorting by new arrivals, lowest price or customer ratings.


This is one of the most important features if we want to differ the search result based on the different age groups of users. For example, teenagers searching for “Grand Theft Auto” might be looking for game strategies; mothers searching the same want to know if the game is appropriate for their kids. Personalization allows you to “boost” results that might be subjectively more in line with a particular user’s tastes.


Algolia lets you consider and configure synonyms for your search query which tells the engine which words and expressions should be considered equal. For example table <=> worktable and pants ⇔ trousers. So, a search for “table” will also find “worktable”, and “worktable” will also find “table”.


That has been my experience with Algolia so far. I hope this gives you enough reasons to try it out and experience how fast it is as compared to traditional database solutions.

Thank you for reading.

Share this