Why Meilisearch
Meilisearch is a Rust-powered search engine that delivers sub-50ms results with typo tolerance, faceting, and geosearch out of the box. It pairs naturally with Meridian's real-time pipeline because documents can be pushed via a RESTful JSON API with zero schema migrations.
Indexing flow
- Spin up Meilisearch Cloud or a self-hosted instance on your VPS.
- POST documents to
/indexes/meridian/documents. - Configure
searchableAttributesandfilterableAttributesin settings. - Query from your Next.js API routes or server components.
Typo tolerance
Meilisearch uses a Levenshtein-based algorithm that matches “merdian” to “meridian” automatically. You can tune minWordSizeForTypos per index to avoid false positives on short tokens.
Faceting & filters
Declare attributes like category or tier as filterable, then append ?filter=category=pro to your search requests. Facet distributions come back in the same response so you can render counts without a second round-trip.
Next.js integration
Use the official meilisearch JS client inside an API route handler. Cache frequent queries with Meridian's Upstash KV layer to stay within your Meilisearch rate limits while keeping latency under 20ms for warm hits.
Next step: Meilisearch sync recipe — keep your index in lockstep with Meridian events.