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.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 92da8a8c-352f-11f1-9bc6-00163e2b0d79 --target codex先 dry-run,确认写入项后再运行此命令。
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.
常见问题
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.
引用来源 (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
TokRepo 相关
讨论
相关资产
Meilisearch — Lightning-Fast Open Source Search Engine
Meilisearch is a fast, typo-tolerant, hybrid search engine API with AI-powered semantic search. Drop-in alternative to Algolia and ElasticSearch with simple deployment.
Apache DataFusion — Fast In-Process SQL Query Engine in Rust
An extensible query engine written in Rust that uses Apache Arrow as its in-memory format, enabling fast analytical SQL queries embeddable in any application.
Yazi — Blazing Fast Terminal File Manager in Rust
Yazi is a blazing fast terminal file manager written in Rust, based on async I/O. Preview images and videos in terminal, fuzzy search, batch operations, plugin system, and seamless integration with tools like fzf, zoxide, and rg.
Cadence — Distributed Workflow Execution Engine by Uber
Cadence is a distributed, scalable, fault-tolerant workflow orchestration engine developed by Uber for executing long-running business logic as durable, stateful workflows that survive process and infrastructure failures.