All Posts
Headless Commerce June 12, 2026

Algolia vs Typesense vs Meilisearch on Sanity-Powered Storefronts (2026)

Sanity has become the default CMS for headless commerce front-ends, but it ships no native search. The choice between Algolia, Typesense, and Meilisearch shapes your indexing architecture, your hosting bill, and how cleanly AI-powered search fits into your storefront.

Sanity has won the headless CMS slot for serious commerce front-ends. The structured content model, the GROQ query language, and the Studio editing experience map well to product-heavy storefronts running on Shopify Hydrogen, Next.js Commerce, or Remix. What Sanity does not ship is search. Once your storefront grows past a few hundred SKUs, the search infrastructure decision becomes the next architecture choice that shapes how the storefront scales.

The three serious contenders are Algolia, Typesense, and Meilisearch. Each takes a different position on the cost-vs-control axis, and each integrates with Sanity in a meaningfully different way. This is the comparison for engineering teams making the call in 2026.

The Core Trade-off Each Vendor Represents

Algolia is the managed search service with the deepest commerce feature set and the highest price. Typesense is the open-core search engine with a clean API, generous free tier, and recently a managed offering that hits a strong cost-quality balance. Meilisearch is the open-source search engine with the friendliest developer experience and an aggressively-priced cloud tier.

The Sanity integration shape matters. All three integrate via webhooks (Sanity emits a document change event, your indexer pulls the document and writes to search), but the indexing patterns, the search relevance tuning, and the AI search story differ enough to drive different architectures.

Capability Algolia Typesense Meilisearch
Open source core No (proprietary) Yes (GPL-3) Yes (MIT)
Self-hosting option No Yes Yes
Managed cloud Yes (Algolia) Yes (Typesense Cloud) Yes (Meilisearch Cloud)
Vector search Yes (NeuralSearch) Yes (built-in) Yes (experimental)
Hybrid search (BM25 + vector) Yes Yes Yes (v1.10+)
Typo tolerance default Yes Yes Yes
Faceting and filtering Best-in-class Strong Strong
Real-time indexing Yes Yes Yes
Sanity-native integration Community plugin Custom webhook Custom webhook
Pricing model Records + operations Cluster size Cluster size
Starting cost (10k records) ~$500/mo $0 (open source) or $89/mo (cloud) $0 (open source) or $30/mo (cloud)

The starting cost row understates the gap. Algolia's commerce-tier pricing accelerates fast: a storefront with 100k products and meaningful search volume lands at $2,000-5,000 per month easily. The same workload on Typesense Cloud is $200-400. Self-hosted Meilisearch on a single VM runs $50-150 in compute.

The Sanity Integration: Webhooks Are the Backbone

All three searches integrate with Sanity the same way at the architectural level: Sanity emits document change events via webhooks, your indexer service processes the event, and writes a transformed document to the search index. The differences live in the indexer code and the available tooling.

Sanity ships a first-party Algolia plugin in the Studio. You add the plugin, configure your Algolia application ID and admin key, and the Studio surfaces an "Index" tab on document schemas. Manual reindexing is a click. Webhook configuration is documented and well-tested. For Algolia specifically, the integration overhead is minimal.

Typesense and Meilisearch require custom indexers. The pattern is the same: deploy a small service (Cloud Run, Lambda, Vercel function) that receives Sanity webhook payloads, queries the full document via GROQ if needed (Sanity webhooks ship the document but not its references), transforms the structure to match your search index, and writes via the search API. We typically ship this as a TypeScript service in 200-400 lines of code per integration.

The Typesense and Meilisearch indexers benefit from explicit transformation logic. You can shape exactly what fields enter the index, how product variants get flattened, and how localized content gets handled. The Algolia plugin's convenience comes with a less flexible indexing pipeline; for storefronts with non-standard product models, the plugin often needs supplementing with a custom worker anyway.

Sample Indexer Architecture

The pattern we deploy most often for Sanity-to-search integrations looks like this:

// Sanity webhook -> Cloud Run indexer
import { createClient } from '@sanity/client'
import Typesense from 'typesense'

const sanity = createClient({
  projectId: process.env.SANITY_PROJECT_ID,
  dataset: process.env.SANITY_DATASET,
  apiVersion: '2026-01-01',
  token: process.env.SANITY_TOKEN,
})

const typesense = new Typesense.Client({
  nodes: [{ host: process.env.TYPESENSE_HOST, port: 443, protocol: 'https' }],
  apiKey: process.env.TYPESENSE_API_KEY,
})

export async function handler(req) {
  const { _id, _type, transition } = req.body
  if (_type !== 'product') return new Response('skipped', { status: 200 })

  if (transition === 'disappear') {
    await typesense.collections('products').documents(_id).delete()
    return new Response('deleted', { status: 200 })
  }

  // Fetch full document with references resolved
  const doc = await sanity.fetch(
    `*[_id == $id][0]{
      _id, title, slug, price, "image": image.asset->url,
      "category": category->title,
      "variants": variants[]->{ sku, color, size, price }
    }`,
    { id: _id }
  )

  const indexed = {
    id: doc._id,
    title: doc.title,
    slug: doc.slug.current,
    price: doc.price,
    image: doc.image,
    category: doc.category,
    variant_skus: doc.variants?.map(v => v.sku) ?? [],
    variant_colors: doc.variants?.map(v => v.color) ?? [],
  }

  await typesense.collections('products').documents().upsert(indexed)
  return new Response('indexed', { status: 200 })
}

The same pattern works for Meilisearch with a one-line client swap. For Algolia, the plugin handles most of this automatically, but the trade-off is that you have less control over the indexed document shape.

Search Relevance: Where the Vendors Diverge

For pure keyword-based product search ("nike air max blue size 10"), all three vendors deliver acceptable results out of the box. The differences emerge in three areas: typo tolerance behavior, synonym handling, and the recently-meaningful vector search story.

Algolia's typo tolerance is aggressive by default and configurable in detail. The relevance model has been tuned against commerce workloads for over a decade, and it shows. For storefronts where product names contain SKU codes, brand variations, and color descriptors, Algolia's out-of-the-box ranking is often the best.

Typesense ranks slightly behind on edge cases but catches up fast with synonym configuration. The query API exposes the ranking knobs explicitly, which makes tuning predictable. For teams who want to understand why a particular result ranks where it does, Typesense is the easiest to reason about.

Meilisearch sits between the two on relevance quality and is the easiest to set up. The defaults are sensible, the API is clean, and for storefronts with straightforward product taxonomies, Meilisearch's out-of-the-box ranking is fine. Tuning beyond that requires more iteration than Typesense.

Vector Search and AI: The 2026 Differentiator

All three vendors now offer vector search. The implementation quality and the operational story differ meaningfully.

Algolia NeuralSearch combines BM25 keyword search with vector similarity in a hybrid model. The vectors are generated by Algolia using its own embedding model (you can also bring your own). NeuralSearch is on Algolia's commerce-tier pricing, which puts it above $1,500/month for non-trivial catalogs.

Typesense ships hybrid search natively. You provide embeddings (OpenAI, Cohere, your own self-hosted model), Typesense stores them alongside the keyword index, and a single query returns hybrid-ranked results with configurable BM25-to-vector weighting. The architecture is clean and the cost is low because Typesense does not charge for vector storage separately from cluster size.

Meilisearch added vector search in v1.6 (2024) and hybrid search in v1.10. The implementation is solid but less mature than Typesense's. Embedding integrations with OpenAI and Hugging Face are first-class. For self-hosted setups, Meilisearch is the easiest vector-capable search engine to operate.

For storefronts adding AI-powered features (semantic product search, "show me products like this one," AI-generated product descriptions feeding search), Typesense currently has the best price-to-capability ratio. Algolia has the most polished commerce-specific feature set but at a price that is hard to justify until your storefront is doing serious revenue.

Pricing in Detail

For a storefront with 50,000 products, 5 million monthly search queries, and standard commerce features (faceting, typo tolerance, basic AI search):

Vendor Monthly cost (estimated) Notes
Algolia $1,800-2,400 Commerce Standard tier, includes NeuralSearch
Typesense Cloud $290-450 8GB cluster, hybrid search included
Typesense self-hosted $80-150 Single c6g.2xlarge on AWS, includes ops time
Meilisearch Cloud $190-350 Pro tier with vector search
Meilisearch self-hosted $50-120 Single VM on Hetzner or DigitalOcean

The TCO calculation needs to include engineering time. Self-hosted options add 5-10 hours per month of ops time once running smoothly, more during the first three months. Managed tiers eliminate this overhead. For teams with strong DevOps capability already in place, self-hosted Typesense or Meilisearch is the obvious cost winner. For teams without that capability, the managed tiers are worth the markup.

When To Pick Which on Sanity-Powered Storefronts

Choose Algolia when: you are on Shopify Plus or SFCC at $5M+ annual GMV, your search-driven revenue is meaningful and quantifiable, your team values commerce-specific features (merchandising rules, A/B testing on relevance, personalization signals), and the Algolia price is justifiable against ROI. The Sanity Studio plugin is a real productivity win for editorial workflows.

Choose Typesense (managed cloud) when: you want strong relevance, hybrid AI search, and a clean integration story without Algolia's pricing. This is our default recommendation for new Sanity-powered storefronts in the $1M-$15M GMV range. The custom indexer adds a small amount of build complexity in exchange for major cost savings and full control.

Choose Meilisearch (managed or self-hosted) when: search is a feature, not a revenue lever, and you want the lowest operational burden. Storefronts with simple product taxonomies and straightforward search needs are well-served by Meilisearch. For self-hosted setups, Meilisearch is the easiest of the three to run.

The mixed-vendor option (Algolia for storefront product search, Typesense or Meilisearch for editorial content search across blog and CMS) is worth considering for high-volume storefronts. It separates the commerce-tier costs from the long-tail content search that does not need commerce-grade relevance.

How To Evaluate This For Your Storefront

Three-step evaluation we run with clients:

First, audit your current search analytics if you have them. Top queries, conversion rates from search, zero-result rates, average position of clicked results. This tells you whether search is currently a strength or a weakness, and how much improvement is worth.

Second, prototype against a representative sample of 1,000-5,000 SKUs. Each of the three vendors offers a generous free tier or trial. Build the indexer, run the same query set against each, compare relevance, latency, and indexing speed.

Third, model the 12-month cost trajectory honestly. Algolia's pricing accelerates with growth; Typesense and Meilisearch scale more gradually. The right answer at 10k SKUs may be the wrong answer at 100k SKUs.

Contra Collective has been architecting Sanity-powered storefronts for enterprise commerce clients, and the search infrastructure choice is one of the highest-leverage decisions in that architecture. If you are evaluating search vendors for a headless commerce storefront on Sanity, we can help structure the evaluation, prototype the integration, and build the production indexer pipeline.

FAQ

Does Sanity have a built-in search I can use first?

Sanity ships full-text search via GROQ's match operator, which is fine for editorial content and admin dashboards but not for storefront product search. It lacks faceting, ranking controls, typo tolerance, and the latency profile required for storefront experiences. Treat Sanity's built-in search as a development convenience, not a production solution.

Can I use Shopify's built-in search instead of any of these?

If you are running headless on Shopify, the Storefront API's search is improved but still inferior to dedicated search infrastructure for non-trivial catalogs. The faceting, typo tolerance, and relevance tuning all lag. For headless commerce, a dedicated search vendor is the right architecture once you exceed a few thousand SKUs or need faceted browse experiences.

What about Elasticsearch or OpenSearch?

Both work but require significantly more operational investment than the three options here. For teams without dedicated search infrastructure engineering, Elasticsearch is overkill. If you already run Elasticsearch for other workloads, extending it to commerce search is reasonable; if you do not, Typesense or Meilisearch give you 80% of the capability at 20% of the operational complexity.

How long does the initial indexing take?

For Algolia, 10k products indexes in 5-10 minutes once the webhook pipeline is configured. Typesense and Meilisearch both index 10k documents in under 2 minutes on default cluster sizes. Initial reindexing of a 100k-product catalog typically completes in 15-30 minutes across all three vendors, with the bottleneck being your indexer service throughput rather than the search engine.

Does any of this support multi-language storefronts on Sanity?

All three support multi-language indexes through separate index-per-locale patterns. Sanity's internationalization plugin maps cleanly to this pattern: each translated document version gets indexed into the locale-specific search index. For storefronts serving more than 5 locales, the indexer architecture matters more than the search vendor choice; we typically build a single indexer that fans out to all locale indexes from a single Sanity webhook event.

[ 02 ] — Keep Reading

More from the lab.

Aug 2, 2026 Headless Commerce

Segment vs RudderStack vs mParticle: Customer Data Platform for Headless Commerce (2026)

A customer data platform is the least visible and most load-bearing piece of a headless commerce stack. It is the layer that captures every event from the storefront, the mobile app, and the backend, resolves those events into a single view of the customer, and fans them out to analytics, email, ads, and the warehouse. Because it sits in the middle of everything, the CDP choice quietly decides three things that are expensive to change later: whether you own your customer data or rent access to it, how much of your compliance and consent surface lives inside a vendor versus your own infrastructure, and how your bill scales as event volume grows, which in commerce it always does. Segment, RudderStack, and mParticle are the three platforms most enterprise commerce teams shortlist, and they embody genuinely different philosophies rather than being feature-for-feature clones. Segment is the managed incumbent optimized for time to value. RudderStack is the warehouse-first, self-hostable challenger built for teams that want to own the pipeline. mParticle is the mobile-heavy enterprise option with the deepest identity and audience tooling. For a headless architecture, where the storefront is decoupled and events originate from several surfaces at once, the differences in how each handles server-side collection, identity resolution, and pricing at volume are what separate a clean integration from a costly one. This post lays out those differences and the decision framework that follows from them.

Jul 30, 2026 Headless Commerce

Multi Currency and Cross Border Pricing in Headless Commerce: Duties, Rounding, and the Presentment Problem (2026)

Selling internationally on a packaged storefront is mostly a settings screen: turn on the currencies, let the platform convert, and the theme shows the right number. Go headless and the convenience disappears, because now your own frontend is responsible for asking the API for a price in the customer's currency, displaying it with the correct rounding, carrying that currency all the way through the cart and into checkout, and reconciling what the customer paid against what the store settles in. Each of those steps has a way to go wrong that a themed store never exposed you to, and the most common one is subtle: the storefront requests a presentment currency and the API quietly returns the amount in the store's base currency anyway, so the customer sees a euro sign in front of a dollar number. Add duties and import taxes on a cross border order and the surface expands again, because now the total the customer sees at checkout has to include or exclude a duty depending on whether you sell delivered duty paid or delivered duty unpaid, and getting that wrong means either a surprised customer or a margin you did not plan to give away. This post is about the architecture that keeps a headless international store honest: which system owns the converted price, how presentment currency actually flows through the Storefront API, why rounding is a real rule and not a rounding error, and how duties change the checkout total.

Jul 29, 2026 Headless Commerce

Migrating from Salesforce Commerce Cloud to Headless Shopify Plus: A Replatforming Playbook (2026)

The decision to leave Salesforce Commerce Cloud is usually made on cost and velocity, and by the time it reaches engineering it has hardened into a deadline. That is where replatforming projects go wrong, because moving from SFCC to a headless Shopify Plus stack is not a migration in the copy the data and flip the switch sense; it is a rebuild of the parts of your commerce logic that lived inside SFCC cartridges and pipelines, wrapped around a data migration that is the easy part by comparison. SFCC gave you a monolith where the storefront, the business logic, and the platform were fused, and headless Shopify Plus deliberately unfuses them: Shopify becomes the commerce engine behind an API, and the storefront becomes your own application. Everything that made SFCC feel complete, the cartridge ecosystem, the pipeline customizations, the server side rendering baked in, becomes something you now own explicitly. This playbook walks the migration in the order that actually de-risks it: what maps cleanly from the SFCC data model to Shopify, what has to be rebuilt rather than ported, how to protect the SEO equity that a careless cutover destroys, and the sequencing that lets you move without a big bang launch. The projects that fail treat this as a data problem. The ones that succeed treat it as a rebuild with a data migration attached.

Ready when you are

Want to discuss this topic?

Start a Conversation