Typesense — Fast Typo-Tolerant Search Engine
Typesense is an open-source, typo-tolerant search engine optimized for instant sub-50ms searches. Developer-friendly alternative to Algolia and ElasticSearch.
What it is
Typesense is an open-source search engine built in C++ that delivers sub-50ms search results with typo tolerance out of the box. It provides faceted filtering, geo search, vector/semantic search, and a JavaScript InstantSearch UI.
Typesense targets developers who need a search backend that is simpler to operate than ElasticSearch and more affordable than Algolia, while still delivering fast, relevant results.
How it saves time or tokens
Typesense requires minimal configuration compared to ElasticSearch. There is no cluster management, shard allocation, or mapping complexity. You create a collection with a schema, index documents, and search. Typo tolerance, ranking, and stemming work without tuning.
How to use
- Run Typesense with Docker:
docker run -d --name typesense \
-p 8108:8108 \
-v typesense-data:/data \
typesense/typesense:latest \
--data-dir /data \
--api-key=your-api-key \
--enable-cors
- Create a collection and index documents via the REST API.
- Search using the API or the InstantSearch.js UI library.
Example
# Create a collection
curl 'http://localhost:8108/collections' \
-X POST \
-H 'X-TYPESENSE-API-KEY: your-api-key' \
-d '{
"name": "tools",
"fields": [
{"name": "title", "type": "string"},
{"name": "description", "type": "string"},
{"name": "stars", "type": "int32"}
],
"default_sorting_field": "stars"
}'
# Search with typo tolerance
curl 'http://localhost:8108/collections/tools/documents/search?q=typsnse&query_by=title,description' \
-H 'X-TYPESENSE-API-KEY: your-api-key'
Related on TokRepo
- Database Tools -- Search and database solutions
- AI Tools for RAG -- Retrieval-augmented generation with search
Common pitfalls
- Typesense keeps the entire index in RAM for speed. Ensure your server has enough memory for your dataset size.
- The API key passed at startup is the admin key. Create scoped search-only keys for client-side use to prevent unauthorized writes.
- Typesense does not support multi-node clusters in the open-source edition. Typesense Cloud provides managed clustering.
Frequently Asked Questions
Typesense is open-source and self-hosted, while Algolia is a managed SaaS. Both provide typo-tolerant instant search. Typesense is free to run on your own infrastructure; Algolia charges based on search operations and records.
Yes. Typesense supports vector search alongside keyword search. You can store vector embeddings in a collection and perform nearest-neighbor searches, enabling semantic/hybrid search use cases.
Typesense provides official client libraries for JavaScript/TypeScript, Python, Ruby, PHP, Java, Go, C#, and Dart. There is also an InstantSearch.js adapter for building search UIs.
Yes. Typesense can index and search millions of documents with sub-50ms latency. Performance depends on available RAM since the index is kept in memory.
Yes. You can use scoped API keys to restrict search to specific collections or filter conditions, enabling multi-tenant search where each tenant only sees their own data.
Citations (3)
- Typesense GitHub— Typesense is an open-source typo-tolerant search engine
- Typesense Documentation— Typesense documentation and API reference
- Typesense InstantSearch— InstantSearch.js for building search UIs
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.