Meilisearch is a fast search engine written in Rust that provides full-text search, semantic search via vector embeddings, and hybrid search capabilities through a RESTful HTTP API. The system is designed for sub-50-millisecond search responses with built-in typo tolerance, filtering, faceted search, and geosearch.
The codebase is organized as a Rust workspace containing multiple crates that provide distinct functionality layers. The primary user-facing application is the meilisearch HTTP server crate, which depends on the index-scheduler for task orchestration and milli for the core search engine implementation.
This page provides an overview of Meilisearch's purpose, key features, high-level architecture, and technology stack. For detailed information about specific subsystems, refer to other pages in this wiki.
Meilisearch processes documents in JSON, CSV, or NDJSON formats and builds optimized LMDB-backed search indexes. Documents are indexed through a parallel extraction pipeline in the milli crate, which creates inverted indexes for keyword search and vector indexes for semantic search using the arroy library.
The system exposes a RESTful API built on actix-web that handles document ingestion, search queries, and administrative operations. All write operations (document additions, index creation, settings changes) are enqueued as tasks in the IndexScheduler, which processes them asynchronously with automatic batching for efficiency.
Sources: README.md26-28 README.md52-62 Cargo.toml1-27
| Feature | Implementation | Description |
|---|---|---|
| Keyword Search | milli inverted indexes | Full-text search with word-level matching using inverted indexes. |
| Semantic Search | arroy vector store | Vector similarity search using embeddings from OpenAI, HuggingFace, or Ollama. |
| Hybrid Search | Weighted fusion | Combines keyword and semantic search with configurable semantic ratios. |
| Typo Tolerance | charabia tokenization | Automatic handling of typos and misspellings with configurable distance thresholds. |
| Filtering | filter-parser AST | Complex filter expressions parsed into an abstract syntax tree. |
| Faceted Search | milli facet databases | Pre-computed facet distributions for fast faceted navigation. |
| Geosearch | _geo attribute | Location-based filtering and sorting using latitude/longitude coordinates. |
| Feature | Implementation | Description |
|---|---|---|
| Asynchronous Processing | IndexScheduler task queue | Background task execution with auto-batching and priority handling. |
| Multi-tenancy | Tenant tokens (JWT) | Document-level access control using API keys and tenant tokens. |
| Ranking Customization | Ranking rules pipeline | Configurable rules: words, typo, proximity, attribute, sort, exactness. |
| Language Support | charabia library | Tokenization and normalization for multiple languages including CJK support. |
| Webhooks | NDJSON notifications | HTTP callbacks on task completion events. |
| Feature | Implementation | Description |
|---|---|---|
| HTTP API | actix-web routes | RESTful API with OpenAPI specification generated via utoipa annotations. |
| Authentication | meilisearch-auth crate | API key management with fine-grained permission scopes. |
| CLI Tools | meilitool crate | Command-line administration utilities for database operations. |
Sources: README.md52-62 Cargo.toml4-27 crates/milli/Cargo.toml21-95
Meilisearch follows a layered architecture organized into distinct functional layers:
Layered Architecture Diagram
Sources: Cargo.toml4-27 crates/meilisearch/Cargo.toml16-112
The Meilisearch repository is organized as a Cargo workspace with the following crate structure. For details, see Workspace Structure.
Workspace Dependency Graph
Sources: Cargo.toml4-27
The system has multiple entry points that converge on the IndexScheduler for coordination:
Entry Points and Task Flow
Sources: crates/meilisearch/Cargo.toml43-52 crates/index-scheduler/Cargo.toml1-49
Meilisearch is distributed in two editions controlled by Cargo feature flags. For details, see Enterprise Edition.
The default build configuration compiles only the MIT-licensed Community Edition code. This includes:
milli crate.actix-web.index-scheduler.meilisearch-auth.License: MIT License
Build Command: cargo build --release
The Enterprise Edition is compiled by enabling the enterprise Cargo feature flag. This adds functionality in enterprise modules:
| Feature | Description |
|---|---|
| Document Sharding | Distribute documents across multiple Meilisearch instances. |
| S3 Snapshots | Stream snapshots directly to S3 storage. |
| Remote Instance Coordination | Coordination for federated search and network topology. |
License: Business Source License 1.1 (converts to MIT after 4 years).
Build Command: cargo build --release --features enterprise
Sources: Cargo.toml1-41 crates/meilisearch/Cargo.toml156
Meilisearch is built on carefully selected dependencies from the Rust ecosystem. For details, see Technology Stack.
| Component | Technology | Purpose |
|---|---|---|
| Storage Engine | heed (LMDB) | Persistent, ACID-compliant storage with zero-copy reads. |
| HTTP Framework | actix-web | High-performance asynchronous HTTP server. |
| Async Runtime | tokio | Underlying event loop and multi-threading management. |
| Tokenization | charabia | Language-aware text segmentation and normalization. |
| Vector Search | arroy / hannoy | HNSW-based vector similarity search integrated with LMDB. |
| Parallelism | rayon | Multi-threaded indexing and data extraction. |
Sources: crates/milli/Cargo.toml21-95 crates/meilisearch/Cargo.toml16-82
For detailed information about specific aspects of Meilisearch:
Refresh this wiki