Skip to content

Migration guide

Migrating from Algolia to Headband

Move your records with a short script, then swap the front-end code. After that, each search job can run on the engine that suits it.

Jump to a section

Move your records first

There is no import tool for an Algolia export yet. It takes five steps.

  1. Export from Algolia

    Export the index as JSON. Each record keeps its objectID.
  2. Create the index and send the records

    Make objectID the index's primary key, and send the records with an admin key from your machine or a server. A request can carry at most 4 MB, so the import script in the docs splits the file, waits out rate limits and checks each batch.
  3. Set your fields again

    Searchable attributes, facets, custom ranking, sorts, synonyms and rules do not carry over. Set them in the dashboard's Tune tab or with the settings API, as your engine takes them.
  4. Leave out private fields

    A search key can read every field you index.
  5. Port partial updates to PATCH

    Send partialUpdateObject calls as PATCH /v1/documents, not POST. A POST replaces the whole record, so a price update would wipe its name and brand.

Then swap the front end, in 3 steps

  1. Install @headband/react

    This is an InstantSearch-inspired React kit. If you've been using react-instantsearch with Algolia, the mental model will feel familiar, but this is not a drop-in replacement.

    terminal
    npm i @headband/react
  2. Replace algoliasearch(...) with headband(...)

    Your client initialization changes by one line. The API surface is intentionally similar.

    JSX
    const searchClient = headband(
      'https://headband.dev',
      'hb_src_YOUR_SEARCH_KEY'
    );
  3. Replace <InstantSearch> with <HeadbandProvider>

    Components have the same names where possible (<SearchBox>, <Hits>, <RefinementList>, <Pagination>) but wrapper props change from Algolia's searchClient/indexName shape to Headband's client/index shape.

    JSX
    <HeadbandProvider
      client={searchClient}
      index="products"
    >
      <SearchBox />
      <Hits hitComponent={Hit} />
    </HeadbandProvider>

Side-by-side: SearchBox + Hits

Before (Algolia)

JSX
import algoliasearch from 'algoliasearch/lite';
import {
  InstantSearch, SearchBox, Hits
} from 'react-instantsearch';

const searchClient = algoliasearch(
  'APP_ID', 'SEARCH_KEY'
);

function App() {
  return (
    <InstantSearch
      searchClient={searchClient}
      indexName="products"
    >
      <SearchBox />
      <Hits hitComponent={Hit} />
    </InstantSearch>
  );
}

After (Headband)

JSX
import {
  headband,
  HeadbandProvider,
  SearchBox,
  Hits
} from '@headband/react';

const searchClient = headband(
  'https://headband.dev',
  'hb_src_YOUR_SEARCH_KEY'
);

function App() {
  return (
    <HeadbandProvider
      client={searchClient}
      index="products"
    >
      <SearchBox />
      <Hits hitComponent={Hit} />
    </HeadbandProvider>
  );
}

The Hit component can stay small, but wrapper wiring and some refinement props should be reviewed against the Headband React docs.

Why migrate?

Four reasons to move:

  • One engine per retrieval job

    A catalog on Meilisearch, autocomplete on Typesense, large corpora on Elasticsearch: each index on the engine that suits it, under one API and one key.

  • Pricing escalation

    Algolia's pay-as-you-go bill rises with every search request and every record you store.

  • Vendor lock-in

    Algolia's API is proprietary. Once your client code is shaped around it, leaving is a project, not a switch.

  • Data sovereignty

    Bring your own Meilisearch, Typesense or Elasticsearch, and the index stays in your own cluster, under your own controls.

Feature mapping

SupportedSoon: on the roadmapNot yet: not in the API yet

Algolia featureHeadband equivalentStatus
IndexIndex (per-engine, you choose Meili/Typesense/ES/Visor)
Search-only API keyHeadband search API key (project-scoped)
Admin API keyHeadband admin API key
partialUpdateObjectPATCH /v1/documents: only the fields you send change
searchClient.search()searchClient.search() (Meilisearch-compatible)
Faceted searchNative; Elasticsearch string fields need .keyword
Typo toleranceNative on every engine. Each engine matches typos its own way
SynonymsMeilisearch, Typesense and Visor; Elasticsearch refuses them
Geo search (aroundLatLng, insideBoundingBox, insidePolygon)geo on /v1/search: radius, box and distance sort on every engine but Visor's sort; polygon on Typesense and Elasticsearch
Vector / hybrid searchElasticsearch with a dense_vector field, and Meilisearch once you add an embedders setting. Typesense only when a Sync definition declares a vector field. Not on Visor. You supply the vectors
InstantSearch React@headband/react (InstantSearch-inspired)
Algolia DashboardHeadband Dashboard
llms.txtNative, generated automatically
MCP server for agentsAuthenticated HTTP JSON-RPC MCP endpoint
AI PersonalizationRoadmapSoon
A/B testingHosted experiments (/v1/experiments)
Query SuggestionsRoadmapSoon
Recommend (related items)RoadmapSoon

What doesn't migrate yet

Being honest: Algolia has spent ten years building features that aren't a weekend port.

  • AI Personalization

    Algolia's user-event-driven re-ranking is genuinely better than anything we ship today. On the roadmap, not shipping this quarter.

  • Geo by IP address

    Algolia's aroundLatLngViaIP and automatic radius have no equivalent. Send the point and the radius yourself.

  • Query Suggestions

    Basic version on the roadmap.

  • Recommend / related items

    You can build one today with your own vectors and hybrid search on Elasticsearch or Meilisearch. A built-in version is on the roadmap.

If any of these are critical to your business right now, stay on Algolia for those features and migrate the rest. Headband is happy to be one of several layers in your stack.

Cost comparison

For a representative mid-size catalog (~500k records under 2 GB of JSON, ~2M monthly search operations):

OptionApprox. monthly cost
Algolia, pay as you go$800 to $2,500
Headband Pro, one 4 GB always-on Meilisearch engine$69
Headband Pro, one 8 GB always-on Meilisearch engine$129

An always-on engine is billed by its RAM only, so its searches and stored data cost nothing extra. Pro includes 4 GB of always-on RAM, and each GB above that is $15 a month. Size the engine to your index: on we measured 1M documents (about 1 GB of JSON) on our production hardware, and a 4 GB Meilisearch engine served 308 searches a second against 1,799 for 8 GB. A catalog near 2 GB of JSON has a larger index, so start at 8 GB and measure. The Algolia figure is our estimate from its published pay-as-you-go rates, not a quote.

The point isn't that we're always cheaper; for small workloads Algolia's free tier is fine. The point is the shape of the bill: Starter is $12 a month with 250,000 searches included, and past what a plan includes, searches cost between $0.01 and $0.03 per 1,000, less on bigger plans.

Next steps

Stuck? Email support@headband.dev. We answer.

Start free