Meilisearch is an open-source search engine that delivers instant, typo-tolerant search results. It is like Algolia, but free and self-hosted.
What Is Meilisearch?
Meilisearch is a lightning-fast, open-source search engine built in Rust. Sub-50ms searches, typo tolerance, faceted filtering — all out of the box.
Quick Start
# Docker
docker run -p 7700:7700 getmeili/meilisearch
# Or download binary
curl -L https://install.meilisearch.com | sh
./meilisearch --master-key='your-key'
The API
Add Documents
curl -s -X POST 'http://localhost:7700/indexes/products/documents' \
-H 'Authorization: Bearer your-key' \
-H 'Content-Type: application/json' \
-d '[
{"id": 1, "name": "MacBook Pro", "category": "laptops", "price": 1999, "brand": "Apple"},
{"id": 2, "name": "ThinkPad X1", "category": "laptops", "price": 1499, "brand": "Lenovo"},
{"id": 3, "name": "iPhone 16", "category": "phones", "price": 999, "brand": "Apple"},
{"id": 4, "name": "Galaxy S25", "category": "phones", "price": 899, "brand": "Samsung"}
]'
Search (instant, typo-tolerant)
# Typo tolerance: "macbok" finds "MacBook"
curl -s 'http://localhost:7700/indexes/products/search' \
-H 'Authorization: Bearer your-key' \
-d '{"q": "macbok"}' | jq '.hits[].name'
# Output: "MacBook Pro"
# With filters
curl -s 'http://localhost:7700/indexes/products/search' \
-H 'Authorization: Bearer your-key' \
-d '{"q": "laptop", "filter": "price < 1500", "sort": ["price:asc"]}'
Configure Index
# Set filterable and sortable attributes
curl -s -X PATCH 'http://localhost:7700/indexes/products/settings' \
-H 'Authorization: Bearer your-key' \
-H 'Content-Type: application/json' \
-d '{
"filterableAttributes": ["category", "brand", "price"],
"sortableAttributes": ["price", "name"],
"searchableAttributes": ["name", "brand", "category"]
}'
JavaScript SDK
import { MeiliSearch } from 'meilisearch'
const client = new MeiliSearch({
host: 'http://localhost:7700',
apiKey: 'your-key'
})
// Search
const results = await client.index('products').search('laptop', {
filter: ['price < 2000', 'brand = Apple'],
sort: ['price:asc'],
limit: 10,
})
console.log(`Found ${results.estimatedTotalHits} products in ${results.processingTimeMs}ms`)
Meilisearch vs Alternatives
| Feature | Meilisearch | Algolia | Elasticsearch |
|---|---|---|---|
| Open source | Yes | No | Yes (partial) |
| Setup time | 1 minute | 5 min | 30+ min |
| Typo tolerance | Built-in | Built-in | Config needed |
| Speed | Sub-50ms | Sub-50ms | 100-500ms |
| Free tier | Unlimited (self-hosted) | 10K req/mo | Self-hosted |
| RAM usage | Low | N/A | High |
Need to search scraped web data? Scrapfly extracts data from any website. Email spinov001@gmail.com for scraping + search solutions.
Top comments (0)