Caching and search

Meilisearch

Meilisearch is a fast search engine written in Rust with search-as-you-type, typo tolerance and simple setup.

What it is

Meilisearch is built for the search a user sees on a site: results appear while typing, word typos are fixed and relevance works without complex tuning.

It is a single Rust binary with a REST API. The index lives on disk and documents are JSON. It has filters, facets, sorting, synonyms, and also hybrid and vector search.

It is developed by the French company Meili. The open source version (Community Edition) is MIT, while some enterprise features and the Meilisearch Cloud service are paid.

Use it when

  • You need fast search over a product catalog, docs or a blog.
  • You want it to work out of the box without tuning analyzers.
  • You need typo tolerance and search-as-you-type.

Avoid it when

  • You need log analytics with heavy aggregations over terabytes.
  • You need advanced queries and big cluster operations: Elasticsearch and OpenSearch are stronger here.

Key concepts

Typo tolerance
Search finds a word even with one or two typos in the query.
Ranking rules
An ordered list of relevance rules: words, typos, proximity, exactness.
Filterable attributes
Fields allowed for filters and facets, which must be declared in the index settings.
API keys
Separate keys with limited rights, including ones safe to use in a browser.

Example

Add a document and search with a typo: incepton still finds Inception.

Interview questions

  1. 1. When choose Meilisearch over Elasticsearch?

    When you need fast user-facing search over a limited dataset with minimal setup. For big clusters, logs and complex analytics, prefer Elasticsearch or OpenSearch.

  2. 2. What is search-as-you-type?

    Results update after every typed character. The engine must answer in tens of milliseconds and understand word prefixes.

  3. 3. How do you use Meilisearch safely from a browser?

    Never ship the master key to the frontend. Create a search-only key or a tenant token with restrictions and use that.

Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).