Typesense Search Engine
Use Typesense for instant, typo-tolerant search with automatic schema detection and simple deployment.
Overview
The engine supports multi-field search, faceting, filtering, sorting, geo search, vector search, and grouping. Its relevance algorithm considers text match quality, field weights, and custom ranking scores. Typesense provides built-in curation (pinning/hiding specific results), synonyms, and search analytics. The vector search feature enables semantic search when combined with embedding models.
Typesense can be deployed as a single node or a highly available cluster with automatic leader election and data replication. Typesense Cloud provides a managed offering. The InstantSearch.js adapter enables using Algolia InstantSearch UI components with a Typesense backend. The JavaScript client works in both Node.js and browsers with full TypeScript support.
Who Is This For?
- Build instant product search with typo tolerance
- Implement vector-based semantic search
- Add search with Algolia InstantSearch UI connected to Typesense
- Deploy a self-hosted search engine as an Algolia alternative
Installation
npm install typesense Configuration
import Typesense from "typesense"
const client = new Typesense.Client({
nodes: [{ host: "localhost", port: 8108, protocol: "http" }],
apiKey: process.env.TYPESENSE_API_KEY!,
})
// Create collection with schema
await client.collections().create({
name: "products",
fields: [
{ name: "name", type: "string" },
{ name: "price", type: "float", facet: true },
{ name: "category", type: "string", facet: true },
],
})
// Search
const results = await client.collections("products")
.documents().search({ q: "laptop", query_by: "name" }) Explore AI Tools
Discover the best AI tools that complement your skills
Read AI & Design Articles
Tips and trends in the world of design and AI
Related Servers
Sentry Error Tracking
Monitor errors and performance issues in production with Sentry. AI agents can triage alerts and suggest fixes based on stack traces.
PostHog Product Analytics
Track product usage, manage feature flags, and analyze user behavior with PostHog, an open-source product analytics platform.
Database Query Builder
Generate and optimize SQL queries with AI assistance. Build complex queries, analyze execution plans, and improve database performance.