Meilisearch's whole pitch fits in one sentence: search-engine quality results without the operational weight of Elasticsearch or the recurring cost of a hosted SaaS search product — and for a large share of projects, that tradeoff is exactly right.
Meilisearch is an open-source, self-hostable search engine designed for fast, typo-tolerant, relevance-ranked search with a notably simple setup and configuration model compared to alternatives like Elasticsearch. It also offers a managed cloud option, giving you the choice between self-hosting for cost control or a hosted service for reduced operational overhead.
Why Meilisearch Matters (and When to Skip It)
Elasticsearch is powerful but has a real operational learning curve — cluster management, mapping configuration, query DSL complexity. Meilisearch deliberately trades some of Elasticsearch's flexibility for a dramatically simpler setup and configuration experience, often getting a team to good search results in an afternoon rather than a multi-day setup process.
Skip Meilisearch if you need Elasticsearch's specific advanced capabilities (complex aggregations, very large-scale distributed clusters) or already have Elasticsearch expertise and infrastructure in place — Meilisearch optimizes for simplicity, which means less configurability at the far end of complex use cases.
Getting Started with Meilisearch
Running Meilisearch locally (or self-hosted):
docker run -p 7700:7700 -e MEILI_MASTER_KEY='your-key' getmeili/meilisearch:latest
Indexing data:
import { MeiliSearch } from "meilisearch";
const client = new MeiliSearch({
host: "http://localhost:7700",
apiKey: process.env.MEILI_MASTER_KEY,
});
const index = client.index("products");
await index.addDocuments(products.map(p => ({ id: p.id, ...p })));
Querying:
const results = await index.search("running shose"); // typo tolerated automatically
console.log(results.hits);
Configuring searchable and filterable attributes:
await index.updateSearchableAttributes(["name", "description"]);
await index.updateFilterableAttributes(["category", "price"]);
Core Meilisearch Concepts Every Developer Should Know
Typo tolerance and ranking work out of the box with sensible defaults, unlike Elasticsearch where relevance tuning is largely manual configuration from the start — this is Meilisearch's core value proposition, good-enough relevance without deep tuning work.
Search-only API keys scope client-side access safely, the same pattern as Algolia — generate a restricted key for browser use, keep the master key server-side only:
const searchClient = new MeiliSearch({
host: "https://your-instance.com",
apiKey: process.env.MEILI_SEARCH_ONLY_KEY, // client-safe
});
Filterable and sortable attributes must be explicitly declared before you can filter or sort on them — an unconfigured attribute used in a filter query will simply fail, a common early setup gap.
Self-hosting means you own uptime, backups, and scaling, unlike a fully managed SaaS search product — a real operational tradeoff against the cost savings and control self-hosting provides, worth weighing honestly against your team's operational capacity.
Common Meilisearch Mistakes and How to Fix Them
Mistake 1: using the master key in client-side code. Same risk category as any admin key exposed to the browser — full write access to indexes if leaked. Fix: generate and use a search-only key for any client-side queries.
Mistake 2: not declaring filterable/sortable attributes ahead of use, leading to confusing filter failures. Fix: explicitly configure filterableAttributes and sortableAttributes for every field you intend to filter or sort by.
Mistake 3: no monitoring or backup strategy for a self-hosted instance. Treating Meilisearch as if it doesn't need the same operational care as a database is a common gap — index data loss without backups is a real risk. Fix: apply the same backup and monitoring discipline to a self-hosted Meilisearch instance as you would any stateful service.
When Should You Use Meilisearch Instead of Algolia?
Use Meilisearch when you want to self-host for cost control, own your data infrastructure, or prefer open-source tooling — it's a strong alternative to Algolia's hosted-only model at a lower operating cost for teams willing to manage the instance. Use Algolia when you want a fully managed service with zero operational overhead and don't mind the recurring SaaS cost, especially for smaller teams that would rather not run search infrastructure themselves.
Meilisearch Integration in Production
If self-hosting, set up regular backups (Meilisearch supports snapshot exports) and monitor instance health the same way you'd monitor a database. If using Meilisearch Cloud, the operational burden shifts back to the provider, closer to the Algolia tradeoff, worth choosing deliberately based on your team's capacity to run infrastructure.
Before going live with self-hosted Meilisearch, confirm backups are actually configured and tested — a search index without a recovery plan is one bad deploy away from becoming a real incident.