C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

  • WebSockets
  • Task Scheduling
  • Queues
  • Job Batches
  • Caching
  • Events
  • Broadcasting
  • Notifications
  • SMS Channels
  • File Storage
  • Payment
  • Search
  • Security
  • Security Comparison
  • Performance
  • HTTP/2 Support
  • Deployment
Discovery

Search

A powerful abstraction for search engines. Start with simple Database search and scale to Algolia or Elasticsearch later.

Unified Search

Standard interface for Database, Algolia, or Elasticsearch.

Database Driver

Built-in SQL support via LIKE queries.

Driver Agnostic

Swap search engines without changing application code.

Extensible

Easily add support for vector DBs or other engines.

Usage

search.service.ts
1import { searchManager } from "canxjs/search";
2
3// 1. Search using default driver (database)
4const results = await searchManager.driver().search("products", "Laptop");
5
6// 2. Specific driver (e.g., Algolia or Elasticsearch if configured)
7const results = await searchManager.driver("algolia").search("users", "John");
8
9// 3. Register custom driver
10searchManager.register("algolia", new AlgoliaDriver());

Custom Driver

CustomSearchDriver.ts
1import { SearchDriver } from "canxjs/search";
2
3export class CustomSearchDriver implements SearchDriver {
4 async search(index: string, query: string, options?: any) {
5 // Perform search
6 return [{ id: 1, title: "Result" }];
7 }
8
9 async index(item: any) {
10 // Index item
11 }
12
13 async delete(id: string) {
14 // Remove from index
15 }
16}