Skip to main content

Migrate from Algolia to Meilisearch 2026

·OSSAlt Team
algoliameilisearchmigrationsearchguide
Share:

TL;DR

Migrating from Algolia to Meilisearch means exporting your index as JSON, importing it into a self-hosted Meilisearch instance, and swapping one npm package. Because Meilisearch ships an InstantSearch-compatible adapter, your frontend widgets keep working without any UI rewrites. For most teams with fewer than a million records, the full migration takes three days and cuts monthly search costs by 90 percent or more.

Key Takeaways

  • Algolia charges $0.50 per 1,000 search requests and bills separately for records — at 100K records and moderate traffic, costs easily hit $200-500/month
  • Meilisearch is MIT-licensed and self-hosts on any VPS; a $10/month instance handles millions of documents
  • Migration difficulty: Easy — the InstantSearch adapter means zero frontend component changes
  • You gain: full-text search with built-in typo tolerance, faceting, geosearch, and multi-tenant tenant tokens
  • Gotcha: Meilisearch uses filter (singular) where Algolia uses filters (plural) in backend search calls
  • Time investment: 3 days for a typical single-index app, up to two weeks for complex multi-index setups

Why Switch from Algolia to Meilisearch

Algolia is excellent search infrastructure, but the pricing model was designed for large enterprises, not growing startups. You pay for records stored, search operations performed, and certain features like recommend or NeuralSearch are gated behind premium tiers. A product search index with 100,000 SKUs doing 500,000 monthly searches runs roughly $200-350 per month on Algolia's standard plan. Add in the cost of any indexing operations (Algolia charges for both reads and writes at scale) and annual contracts can reach tens of thousands of dollars.

Beyond cost, vendor lock-in is a real concern. Your search tuning, synonyms, ranking rules, and analytics all live inside Algolia's proprietary platform. If Algolia changes pricing, deprecates an API, or suffers an outage, you have no fallback. Several companies discovered this painfully during Algolia's 2023 pricing restructure, which eliminated the free tier for legacy accounts and forced immediate upgrades.

Meilisearch is a Rust-based search engine released under the MIT license. It matches Algolia's core developer experience almost exactly — the same concept of indexes, the same approach to typo tolerance, faceting, and ranking rules — but runs on hardware you control. The project is actively maintained by a dedicated team, ships regular releases, and the cloud-hosted option (Meilisearch Cloud) exists if you want managed infrastructure without self-hosting complexity. For teams comfortable running Docker, the self-hosted path is straightforward and the only ongoing cost is the VPS itself.

Prerequisites

Before starting the migration, make sure you have the following in place:

  • A VPS or cloud server with at least 1 GB RAM and 10 GB disk (more for large indexes) — Ubuntu 22.04 or similar
  • Docker and Docker Compose installed on the target server
  • Node.js 18+ on your local machine for running export/import scripts
  • Your Algolia Application ID and Admin API Key (from the Algolia dashboard under API Keys)
  • A Meilisearch master key — generate one with openssl rand -hex 32
  • Basic familiarity with the command line and your application's search integration code

Step 1: Deploy Meilisearch

The first step is getting Meilisearch running on your server. Docker is the fastest path and ensures you get a reproducible setup with persistent storage. The master key protects your instance — without it, anyone who can reach port 7700 can read and write your indexes.

# Docker
docker run -d \
  --name meilisearch \
  -p 7700:7700 \
  -v meili_data:/meili_data \
  -e MEILI_MASTER_KEY=your-master-key \
  getmeili/meilisearch:latest

Once the container starts, visit http://your-server:7700 in a browser. You should see the Meilisearch mini-dashboard. For production, put Nginx or Caddy in front of it with a proper TLS certificate so your frontend can reach it over HTTPS. You will also want to create a separate search-only API key that your frontend uses, keeping the master key server-side only.

Step 2: Export from Algolia

Algolia's browseObjects iterator is the right tool for bulk exports. Unlike search, it bypasses the 1,000-hit limit and streams every record in the index. Run this script for each index you need to migrate — replace APP_ID, ADMIN_API_KEY, and the index name accordingly.

// Export Algolia index to JSON
const algoliasearch = require('algoliasearch');
const fs = require('fs');

const client = algoliasearch('APP_ID', 'ADMIN_API_KEY');
const index = client.initIndex('products');

let allRecords = [];
await index.browseObjects({
  batch: (objects) => { allRecords = allRecords.concat(objects); }
});

fs.writeFileSync('products.json', JSON.stringify(allRecords));
console.log(`Exported ${allRecords.length} records`);

After exporting records, also export your index settings. Algolia stores your searchable attributes, ranking rules, and synonyms as index-level configuration that you will need to recreate in Meilisearch. Run index.getSettings() and save the output to a JSON file — you will reference it when configuring Meilisearch in Step 5.

Step 3: Import to Meilisearch

Meilisearch's addDocuments method batches records automatically. For very large indexes (over 100K records), split the array into chunks of 10,000 and import sequentially to avoid memory pressure on the server. Meilisearch processes imports asynchronously — each batch returns a task ID you can poll to confirm completion.

const { MeiliSearch } = require('meilisearch');
const products = require('./products.json');

const client = new MeiliSearch({
  host: 'http://localhost:7700',
  apiKey: 'your-master-key',
});

// Create index and add documents
const index = client.index('products');
await index.addDocuments(products);

// Configure searchable attributes (like Algolia's settings)
await index.updateSearchableAttributes([
  'name', 'description', 'category', 'brand'
]);

// Configure filterable attributes (like Algolia's facets)
await index.updateFilterableAttributes([
  'category', 'brand', 'price', 'inStock'
]);

// Configure sortable attributes
await index.updateSortableAttributes(['price', 'rating']);

After the import completes, verify record counts match by calling index.getStats() and comparing against your Algolia export count. A mismatch usually means records were lost due to missing objectID fields — Meilisearch uses id as the default primary key identifier, so ensure every record has a consistent ID field.

Step 4: Update Frontend (InstantSearch)

This is where the migration gets genuinely easy. Meilisearch ships an official InstantSearch adapter that wraps Meilisearch's search API to match Algolia's interface. Every InstantSearch widget you have — searchBox, hits, refinementList, pagination, rangeSlider — continues working without modification.

npm install @meilisearch/instant-meilisearch

Before (Algolia):

import algoliasearch from 'algoliasearch';
import instantsearch from 'instantsearch.js';

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

const search = instantsearch({
  indexName: 'products',
  searchClient,
});

After (Meilisearch):

import { instantMeiliSearch } from '@meilisearch/instant-meilisearch';
import instantsearch from 'instantsearch.js';

const { searchClient } = instantMeiliSearch(
  'http://localhost:7700',
  'your-search-key'
);

const search = instantsearch({
  indexName: 'products',
  searchClient,
});

That is the complete frontend change. Same InstantSearch widgets, same UI — just a different search client. All your existing hits, searchBox, refinementList, and pagination widgets continue working without further changes.

Step 5: Configure Settings

Once your data is imported, map your Algolia settings to their Meilisearch equivalents. Most concepts translate one-to-one, though naming differs in a few cases. Pay special attention to attributesForFaceting versus filterableAttributes — Algolia combines faceting and filtering into one setting, while Meilisearch separates them.

Algolia SettingMeilisearch Equivalent
searchableAttributessearchableAttributes
attributesForFacetingfilterableAttributes
customRankingrankingRules
synonymssynonyms
stopWordsstopWords
typoToleranceBuilt-in (configurable)
distinctdistinctAttribute
replicasNot needed (sort at query time)

Meilisearch handles typo tolerance differently from Algolia. Rather than configuring tolerance level per attribute, Meilisearch applies a global two-typo tolerance by default and lets you tune minimum word lengths and disable it per attribute. Test your search quality after importing settings — you may find Meilisearch returns slightly more results for short queries because it applies typo tolerance more aggressively.

Step 6: Update Backend API Calls

Backend search calls require a small syntax change. The filter syntax is nearly identical, but the parameter name changes from filters to filter, and Meilisearch uses its own numeric filter operators rather than Algolia's SQL-like strings. Most applications need only a find-and-replace.

Before:

const index = algoliaClient.initIndex('products');
const results = await index.search('query', { filters: 'price < 100' });

After:

const index = meiliClient.index('products');
const results = await index.search('query', { filter: 'price < 100' });

The API is very similar — most changes are just import swaps. The response shape also differs slightly: Meilisearch returns hits with an _rankingScore field instead of Algolia's _score, and pagination is handled with offset/limit rather than page/hitsPerPage at the API level (the InstantSearch adapter handles this abstraction for you automatically).

Troubleshooting Common Issues

Search returns no results after import. The most common cause is a mismatch in the primary key. Meilisearch auto-detects the primary key from the first batch of documents, defaulting to any field containing id. If your records use objectID (Algolia's default), you need to either rename the field before import or specify the primary key explicitly when creating the index: client.index('products').addDocuments(records, { primaryKey: 'objectID' }).

Filter queries return errors. Attributes used in filter queries must be listed in filterableAttributes. Unlike Algolia, Meilisearch requires explicit configuration of which fields can be filtered — it does not automatically index all fields as filterable. Add any fields you use in filter queries to the filterableAttributes array and wait for the indexing task to complete.

Typo tolerance behaves differently. Meilisearch applies typo tolerance more aggressively than Algolia on short queries. If you are seeing irrelevant results for 1-2 character searches, configure minimum word sizes: updateTypoTolerance({ minWordSizeForTypos: { oneTypo: 5, twoTypos: 9 } }). This prevents typo tolerance on very short terms.

InstantSearch refinements not working. If refinementList widgets show attributes but clicking does not filter results, the attribute is not in filterableAttributes. Add it and re-run the settings update. Meilisearch indexes are fully searchable immediately after document ingestion, but filter/facet functionality requires the settings task to complete.

Slow search on large indexes. For indexes over 500K documents, Meilisearch's default configuration may lag. Ensure your VPS has at least 2 GB RAM and consider increasing the --max-indexing-memory flag. Also limit searchableAttributes to only the fields actually needed for text search — unnecessary attributes increase index size significantly.

What You Gain by Switching

The financial case is straightforward. A team paying $300/month for Algolia can run Meilisearch on a $15/month VPS with equivalent performance for most workloads. That is $3,420/year in savings, which at a typical SaaS company represents meaningful runway or headcount.

Beyond cost, you gain complete control over your search infrastructure. Your index data never leaves your servers, which matters for healthcare, finance, and other regulated industries where sending customer data to a third-party search vendor requires legal review. You can run Meilisearch in the same private network as your application database, eliminating the latency of cross-internet search requests.

Meilisearch's ranking rules are fully customizable and documented, unlike Algolia's partially opaque relevance algorithms. If you need to boost certain records, you can add a numeric relevance field and rank by it without paying for a premium plan feature.

RecordsAlgoliaMeilisearch Self-HostedSavings
10K$50/month$5/month (VPS)$540/year
100K$200/month$10/month$2,280/year
1M$500+/month$20/month$5,760/year

Monitoring Search Quality Post-Migration

After the initial cutover, track search quality for at least two weeks before canceling Algolia. The key signals to watch are zero-result rate (searches that return no hits), click-through rate on top results, and the distribution of searches by result count. A spike in zero-result searches usually means a category of queries that worked in Algolia via its fuzzy matching is now missing in Meilisearch — typically solved by adjusting typoTolerance settings or adding synonyms.

Meilisearch has a search analytics dashboard in its Cloud offering, but self-hosted deployments require you to instrument this yourself. The simplest approach is to log each search query and its result count to your application database or a lightweight analytics table. After a week, query for searches with zero hits and review the patterns — common typos, product names, or categories that need synonyms. Add them to Meilisearch's synonym configuration and re-run the analysis. Most production deployments stabilize within 2-3 weeks of iterative synonym and ranking tuning.

Migration Timeline

DayTask
Day 1Deploy Meilisearch, export + import data
Day 2Configure settings, swap frontend SDK
Day 3Update backend API calls, test search quality
Week 2Monitor search quality, fine-tune ranking
Week 3Cutover, cancel Algolia

Compare search engines on OSSAlt

Related: Best Open Source Algolia Alternatives 2026 · SaaS Subscription Audit: How Much Are You Spending? · Best Open Source Analytics Tools 2026

See open source alternatives to Algolia on OSSAlt

The SaaS-to-Self-Hosted Migration Guide (Free PDF)

Step-by-step: infrastructure setup, data migration, backups, and security for 15+ common SaaS replacements. Used by 300+ developers.

Join 300+ self-hosters. Unsubscribe in one click.