Elasticsearch is powerful but needs a dedicated team to operate. Algolia is fast but expensive. Typesense is both: a search engine that returns results in under 5ms, handles typos, and runs on a single binary.
What Is Typesense?
Typesense is an open-source search engine optimized for instant search experiences. It stores data in memory for blazing-fast queries, supports typo tolerance and faceted search, and runs as a single binary with no dependencies.
The Free API
Typesense Cloud offers a free tier:
- Free plan: 10,000 documents, 10,000 searches/month
- Sub-5ms search: In-memory engine for instant results
- Typo tolerance: Configurable typo distance
- Faceting: Filter and aggregate results
- Geo search: Location-based search built in
- Semantic search: Vector search with AI embeddings
- SDKs: JavaScript, Python, Ruby, PHP, Go, Java, C#, Dart
- InstantSearch adapter: Drop-in replacement for Algolia
Quick Start
Run Typesense:
docker run -d -p 8108:8108 \
-v /tmp/typesense-data:/data \
typesense/typesense:latest \
--data-dir /data \
--api-key=your-api-key
Create a collection and index:
# Create schema
curl -X POST 'http://localhost:8108/collections' \
-H 'X-TYPESENSE-API-KEY: your-api-key' \
-d '{
"name": "products",
"fields": [
{"name": "name", "type": "string"},
{"name": "price", "type": "float"},
{"name": "category", "type": "string", "facet": true},
{"name": "rating", "type": "float", "sort": true}
],
"default_sorting_field": "rating"
}'
# Index documents
curl -X POST 'http://localhost:8108/collections/products/documents' \
-H 'X-TYPESENSE-API-KEY: your-api-key' \
-d '{"name":"MacBook Pro 16","price":2499.99,"category":"Laptops","rating":4.8}'
Search:
import Typesense from 'typesense';
const client = new Typesense.Client({
nodes: [{ host: 'localhost', port: 8108, protocol: 'http' }],
apiKey: 'your-search-key',
});
const results = await client.collections('products').documents().search({
q: 'mackbook', // typo — still finds MacBook!
query_by: 'name',
filter_by: 'category:=Laptops && price:<3000',
sort_by: 'rating:desc',
facet_by: 'category',
});
Why Teams Choose Typesense
An e-learning platform with 200K courses was using PostgreSQL full-text search. Response times averaged 800ms, and there was no typo tolerance. Students searching for "machine lerning" got zero results. After switching to Typesense, search response dropped to 4ms, typos returned correct results, and course discovery improved by 40%.
Who Is This For?
- E-commerce teams needing instant product search
- Content platforms with large catalogs requiring fast discovery
- Developers wanting Algolia features at self-hosted prices
- Teams outgrowing PostgreSQL full-text search
Start Searching Faster
Typesense gives you instant, typo-tolerant search from a single binary. No cluster management, no dedicated search team.
Need help implementing search? I build custom search solutions — reach out to discuss your project.
Found this useful? I publish daily deep-dives into developer tools and APIs. Follow for more.
Top comments (0)