When Algolia is worth it, and when a query is enough
On this page
The first commit in our Algolia indexer for a large hospital system's site is from October 2017. Since then I have worked on Algolia search on that site, on agency Craft sites through the Scout plugin, and on my own Statamic sites. I still reach for it. I also spent part of this year watching features come back off it. This is the guide I wish I had read in 2017.
What it bought
Search that behaves the way people expect. Providers, locations and medical services on one site, with typo tolerance, facets and results that update as you type, and no search server to run. Each of those indexes is a transformer in config/scout.php that turns a Craft entry into a flat record, plus InstantSearch on the front end. The transformer is the whole back end, and the result is better than anything I would build on a LIKE query.
Geo. In June 2022 I moved the site's locations map onto an Algolia query, because the engine can sort geo-tagged records by distance from the visitor, which Craft did not give me for free.
Facets over taxonomies. On a nonprofit's resource library a colleague's transformer emits taxonomy.lvl0 and taxonomy.lvl1 attributes, the parent term and then parent > child, so InstantSearch can render a hierarchical menu. On a food brand's site the recipe index carries dishes, cuisines, main ingredients and cooking method as arrays, and the page is four menuSelect widgets, a hits widget and twelve results a page. Many records, several dimensions, instant feedback: this is where the index earns its place.
Content from more than one system. In February 2024 I wrote a Craft module that indexes the site's own events alongside events from an external learning platform into one index, with queued jobs on a schedule. The front end does not care where an event came from.
What it cost
The index is a second copy of your data, and the sync is yours. The 2017 indexer was a set of Lambda functions on a cron, every fifteen minutes during the day for some indexes and daily for others. Each run pulled the source data, exported the current Algolia index to S3, diffed added, updated and deleted records, and wrote the diff back. By 2020 synonyms were code in that repo, two-way synonyms for medical services. In 2021 I added a rule that the sync must never delete a hand-made record, so a hand-made record would survive the next run. Later the locations function became a stub that says "This function has been replaced by an on-demand Algolia sync handled in Craft", which is the Scout plugin reacting to element events. Scout brought its own tuning: a bigger batch size for faster syncs, then moving index events into the queue in 2022.
Site search had its own pipeline. The hosted crawler needed exclusion markup in our templates so it would skip parts of pages, and whole pages, we did not want found. In May 2025 I replaced it with a Laravel app of our own: read sitemap-siteSearch.xml, fetch each page, drop nav, header, footer and anything marked .AlgoliaExclude, keep the headings, paragraphs and list items, and store the record in SQLite with an object id derived from the URL. Scout pushes it to Algolia. It runs at 05:00 for one site and 06:00 for the other, and it ships an app:compare-indexes command because the first question after every rebuild is "what changed?" That is a whole application whose only job is to keep a copy of the website inside a search service.
Every template that reads Algolia instead of Craft is a dependency. Over the years the site's templates had started calling Algolia for things that were not search: provider detail pages, location and hospital pages, the provider sitemap, a Yext reporting query, related locations in a sidebar. In 2023 the team moved the detail pages and the sitemap back to Craft; the sitemap commit says "The data already exists in Craft and this ensures future reviews are in-sync". In February 2025 a colleague built an audit page that lists every block and template still calling the Algolia API, and then we migrated the related-locations feature to Craft and Twig: 31 files, 490 lines added, 1,395 removed. A React app and its personalization state were replaced by a Twig filter that sorts location entries by distance and then rating, and hides the block when there are three or fewer. Provider search itself stayed on Algolia. It is the feature the index exists for.
The guide
Use Algolia when a person types into a box and expects results while typing, across thousands of records. When the results need facets over several taxonomies, or distance. When the searchable content comes from more than one system. When the page is statically cached and the search has to happen in the browser anyway.
Use the database when the page already has the entry. Related items, detail pages, sitemaps, reports, anything that renders server-side from a query you can write. The record in Algolia is never fresher than the entry it came from, and every read against it is one that can be stale, rate-limited or billed. Use the database for a short list with one filter too. A few hundred items behind a category dropdown is a query, not an index.
Whichever way you go, budget for the pipeline: environment-named indexes so staging never writes over production, a compare command, a queue for the sync, and a plan for records that only exist in the index.
The short version
Algolia is for the search box. The moment a template asks it for data the CMS already holds, you have bought a second database and the sync job that comes with it.