Typesense is an open-source search engine built for one job: making search on your website feel instant. If your app has a search box and a database LIKE query feels slow or returns bad results, Typesense is the lightweight fix.
How does it work? You send your data to Typesense as JSON documents, and it builds an index. When a user types, Typesense returns ranked results in milliseconds — and it handles typos for free, so "iphne" still finds "iPhone".
# Run Typesense locally with Docker
docker run -p 8108:8108 -v /tmp/data:/data typesense/typesense:27.0 \
--data-dir /data --api-key=xyz --enable-cors
// Index a product, then search it
import Typesense from 'typesense';
const client = new Typesense.Client({
nodes: [{ host: 'localhost', port: 8108, protocol: 'http' }],
apiKey: 'xyz',
});
await client.collections('products').documents().create({
name: 'Wireless Mouse',
price: 499,
category: 'electronics',
});
const results = await client.collections('products').documents().search({
q: 'mouse',
query_by: 'name,category',
});
Typesense is great for beginners because the API is just JSON over HTTP, and the whole engine is one small binary. There is no cluster to tune, no query language to learn — a search call with q and query_by already handles typos, ranking, and filtering better than a SQL LIKE ever will.
When should you use it? For product search on a shop, searching blog posts or docs, and autocomplete. If your users type a word and expect the best matches first, Typesense earns its place — and its typo tolerance is the feature users notice most.
The limits are worth knowing. It is not a primary database — you keep your real data in Postgres or MongoDB and sync a copy into Typesense for searching. It is also best at the search job itself; for heavy analytics or complex joins, use your database.
Start today: run Typesense with Docker, index ten products, and search with a typo in the query. Watching it still find the right product is the moment the tool clicks.
Top comments (0)