Skills2026年4月10日·1 分钟阅读

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 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
先审查命令
npx -y tokrepo@latest install 92da8a8c-352f-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Typesense delivers sub-50ms typo-tolerant search with faceting, geo search, and vector search out of the box.
§01

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.

§02

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.

§03

How to use

  1. 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
  1. Create a collection and index documents via the REST API.
  1. Search using the API or the InstantSearch.js UI library.
§04

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'
§05

Related on TokRepo

§06

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.

常见问题

How does Typesense compare to Algolia?+

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.

Does Typesense support vector search?+

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.

What languages have Typesense client libraries?+

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.

Can Typesense handle millions of documents?+

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.

Does Typesense support multi-tenancy?+

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)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产