Meilisearch information overview

2023-06-14 · Ben Williamson

Why I finally wrote this down

During a refinement session, teammates from engineering, product, and security all had sensible questions about Meilisearch. Same tool, three different fears. Developers wanted SDK paths and index settings. Leadership wanted cost and lift. Security wanted keys, ports, and what might leak to the browser.

I had been running Meilisearch in production across a Craft plus Magento publisher stack, but most of that knowledge lived in Loom links and admin habits. This post is the written field guide I wanted before the first index shipped: what the engine is, how to shape documents, and how to operate it without turning search into a fragile side quest.

What Meilisearch is (in one paragraph)

Meilisearch is an open-source REST search engine (Rust core) with official SDKs and an InstantSearch-compatible frontend layer. It fits well when you need fast typo-tolerant search across one or more indexes without standing up an Elastic-sized cluster. In our case it became a federated discovery layer: publications, newsletters, product-like learning material, each feeding indexes that could be rebuilt independently when upstream shapes changed.

Define the document first

Search quality starts before indexing. Every source system has its own record shape. Search needs a projected document. Mixing those two in one meeting is how teams end up debating synonyms while a cost field is still searchable in the browser.

The conversation I want upfront:

  • Source record: What table, entry, or API object is authoritative?

  • Projected document: What JSON lands in Meilisearch, with what primary key?

  • Field roles: Which fields are searchable, filterable, sortable, or display-only?

  • Private data: What never enters the index even if the UI hides it?

Multitenancy and tenant tokens exist if you must host scoped content. For most marketing and catalog discovery, I still treat the index as public-ish data: if a search-only key leaks, nothing in the index should hurt.

Tune in layers

Ranking rules come after clean fields. My tuning order:

  1. Typo tolerance and searchable attribute lists.

  2. Filterable and sortable attributes (get these wrong and faceting lies).

  3. Synonyms and stop words from real query logs.

  4. Ranking rules, one change at a time.

  5. Review against a shared spreadsheet of bad queries, not room opinions.

A spreadsheet of zero-result and wrong-result examples beats a meeting about "relevance feel." When a regression lands, you want to know which layer moved.

Audience-specific concerns (condensed)

Leadership: Open-source engine, self-hostable, integration lift is small when sync is already automated. Compare to SaaS search pricing at your document volume before assuming Elastic is the default.

Security: One HTTPS port, master key for admin only, search-only keys in browsers with expiration. Use minimum-permission keys per index. Meili-Manager (or similar ops UI) should sit behind your normal admin boundary, not on the public internet with the master key.

Developers: Prefer official SDKs over raw REST. Instant-Meilisearch tracks Algolia InstantSearch patterns closely, which shortens Vue storefront work. Keep a local import command beside the app repo so index shape changes are testable in CI.

Operate it calmly

Treat search as a projection, not the source of truth. When document shape changes, rebuild from upstream rather than hand-editing Meili documents. Deletes deserve the same test coverage as inserts; orphaned documents break discovery quietly.

  • Rebuild indexes from source when fields change.

  • Rotate keys on a schedule; search-only keys still leak if pasted into client bundles.

  • Keep dumps/snapshots in your backup story, but practice full rebuilds too.

  • Document the import command next to the app, not in a runbook only one person knows.

Quick review before go-live

  • Can I draw the source record → projected document mapping on a whiteboard?

  • Are private fields absent from the index, not just hidden in CSS?

  • Do I have twenty bad queries saved before tuning ranking?

  • Does local dev work without Meilisearch (graceful degrade) or fail loudly on purpose?

  • Who rotates keys if the browser bundle leaks?