What to Expect When Installing Algolia Site Search

Haley Johnson, Former Product Manager

Article Categories: #Process, #Tooling

Posted on

Trial-and-error tips to avoid pitfalls and seamlessly implement your client’s site search

In the past, when a client requested a smarter search for their site, that maybe “automatically completes common searches” or “accounts for misspellings” in a way that seems “similar to Google,” our response was usually something along the lines of “only Google can be Google.” Also, Google sunset their site search product back in 2018.

But today, we’ve got good news. Now there are smarter site searches out there that integrate seamlessly with websites, making a site search much smoother and more useful for a user.

Recently, we partnered with an organization in the healthcare space to enhance the search functionality powering their library of specialty resources. As the highest traffic spot on the site, their resource library is full of helpful articles, videos and other educational materials, positioning them as a subject matter expert in their field. Their current setup (powered by Craft’s built-in search) was clunky. It found fairly standard but shallow associations between articles, their categories, and the user’s queries. The nuances of the content called for a tool that could accommodate more complex relationships in order to accurately return results.

The wish list for their new resource library search included:

At Viget, we often recommend Algolia because its fast, powerful search satisfies all of the above constraints. And, thanks to a new plugin, Scout, it’s easier than ever to keep Algolia synchronized with changes in Craft CMS. Let’s say an editor adds new resources to the library or updates the filters, these changes are reflected automatically on Algolia instead of requiring a developer to force a sync. It’s also relatively easy for our front-end developers to implement Algolia, taking just 3-4 days for us to set up a research library with a few hundred entries (which Algolia calls records). A site’s data needs and record count can add some variation to this setup window.

Our client was amazed by the results. Algolia exceeded expectations and the research library was helpful to prospective patients and healthcare org employees alike.

Tip #1: Set Up Different Environments on Separate Indices or Accounts

We thoroughly tested Algolia on a staging environment before pushing it to production. A week later, while our developer was making an update to Algolia to test on the staging site, we noticed a huge spike in search traffic. Algolia analytics designated them as “empty searches.” We received thousands of empty searches a day, atypical for a site of this size and impacting the cost of service, before we realized it was our work on the staging site that likely triggered the spike.

Our first step was to upgrade to a paid plan to be able to engage with Algolia support. Then, we separated the accounts. When our developer separated the staging Algolia account into its own index, the empty searches spiked again as Algolia catalogued the new separated index, which confirmed our suspicions. (Note: If time allows, we recommend separating Algolia’s staging search into its own free account.) We reduced the overall number of records in the staging index as well, since every record counts towards the overall units, which impacts cost.

Tip #2: Disable Scout for Secondary Environments

Once we had separated our staging site into its own index, we disabled the Scout plugin for the staging site. This means that any time a change is made to the staging site, Algolia doesn’t automatically update. Once we disabled Scout on staging, we stopped seeing empty searches when we made changes to Algolia on that environment. Our production site stayed in sync and continued to function as normal, while our developers could proceed with work on staging with greatly reduced impact on usage activities and overall units.

Tip #3: Leverage Developer Support Challenges

While Algolia has a strong product, their customer service is lacking in comparison especially for smaller accounts. Developers will find the most helpful guidance in their robust documentation database or community forum instead of traditional customer support channels. Much of their support seems to follow templated suggestions, and we found our proactive investigation to be faster and more informative. When we experienced a spike in empty searches, we realized that our staging site work was the culprit; a day or two later, Algolia email support all but confirmed our suspicions.

That all being said, we still recommend a pay-as-you-go Algolia for super fast and smart site search with analytics, as long as front-end developers keep the aforementioned tips in mind when setting up the account. Algolia’s solution adds a lot of sophistication to our client’s site search by refining search results and including features associated with Google like predictive text, all while keeping the relevant index up-to-date. The price of this tool is fairly inconsiderate, but the pricing structure can be confusing. Read on for more specifics!

Algolia Terminology & Pricing

Algolia charges by units, which they define as a combination of search requests and records that each search has to crawl. One Algolia unit is equivalent to 1,000 search requests with an index of up to 1,000 records. In the example of the resource library, each record is an item in the library, like an article or video. The resource library is an example of an index, and an Algolia account can contain multiple indices (for example: an English-language resource library and a Spanish-language resource library). It’s important to note that a search request includes all of the batch queries involved in a single search, which means that you can use Algolia’s faceting and federated search without worrying about typo corrections or auto-completes being counted as additional searches.

Algolia’s free plan provides up to 10 units per month, meaning that if your site has fewer than 10,000 search requests a month and fewer than 10,000 records in the index, it qualifies for the free plan. If your site gets larger amounts of traffic, you can use the sliding scale to estimate your cost based on how many thousands of searches you expect to have per month. If you’re expecting 11,000 searches a month and you have fewer than 11,000 records in that index, the standard cost is only $1/month, which is very affordable. While both the free and basic paid plans have analytics on your searches, the main benefit of the paid plan is the email and online support, where an Algolia representative will help in the event of suspicious search behavior. After setting up a free account, we learned the aforementioned tips through trial-and-error, and came out of it feeling like a low monthly premium akin to $6, while not necessary for the amount of traffic or records, buys our client peace of mind.

Alternatively, if your site is large enough to warrant a large number of units (over 5,000 units, or 5 million search requests and 5 million records), you should contact Algolia sales to negotiate a contract outside of pay-as-you-go.

With a lot of different site search software to implement on your site, we’ve had success implementing Algolia on our Craft sites as of late. Algolia is a quick and powerful search that is likely to exceed user and client expectations. It offers features like autocomplete, federated search, synonyms and typo tolerance. While we still recommend Algolia for its helpfulness and affordability, there are a few steps to take while implementing in order to use it successfully. Our steps help with setting up Algolia in a way that prevents any work done on the staging environment from impacting Algolia’s monthly search count. If you’re noticing sudden unexplained spikes in search results, our experience may help you troubleshoot.

Have thoughts about Algolia, custom search, and development best practices? Drop us a line at hello@viget.com.

Related Articles