⚡ Typesense Search for Flarum 2 — fast, typo-tolerant search your members will actually use
Your forum's search is the front door to years of great discussions — but out of the box, it's easy to bounce off. Typesense Search for Flarum swaps in a lightning-fast, typo-tolerant search engine behind Flarum 2's native search box. Members type "kuberntes" and still find the Kubernetes thread. No new UI to learn, no paid service required — just better results, instantly.
Fast, forgiving full-text discussion search that anyone can set up in a few minutes — free and MIT licensed.
🚀 What it does
Flarum 2 shipped a pluggable search architecture, and this extension implements a Typesense driver for it. Text searches are answered by Typesense; everything else — filtering, browsing, permissions — stays exactly as Flarum does it.
- Typo tolerance — misspellings and fat-fingered queries still land on the right discussions
- Speed — Typesense is built for instant, as-you-type search performance
- Drop-in — uses Flarum's existing search box and result views; nothing changes for your members
- Self-host or cloud — run Typesense as a single binary or Docker container, or use Typesense Cloud
🔒 Safe by design
Typesense is only ever asked for candidate discussion IDs and their ranking. Which results a given user may actually see is decided entirely by Flarum's own whereVisibleTo — including tag restrictions — never by Typesense. The search server holds no authorization logic, the browser never talks to it, and your API key stays server-side.
📦 Requirements
- Flarum
^2.0
- A running Typesense server (self-hosted or Typesense Cloud)
⬇️ Installation
composer require ernestdefoe/typesense
Run Typesense yourself in one line (self-hosted example):
docker run -d --name typesense -p 8108:8108 \
-v typesense-data:/data typesense/typesense:27.1 \
--data-dir /data --api-key='CHANGE_ME' --enable-cors
⚙️ Setup
- Admin → Typesense Search — enter host, port, protocol and API key, then Save
- Click Test connection to confirm Flarum can reach the server
- Click Rebuild index (or run
php flarum typesense:index) to index your existing discussions
- Turn on Use Typesense for discussion search and save
That's it — discussion searches are now served by Typesense. New, edited, and deleted content re-indexes automatically through Flarum's queued indexing pipeline (configure a real queue driver like redis or database in production).
php flarum typesense:index # build / refresh the index
php flarum typesense:index --flush # delete the index
Running multiple forums? Several can share one Typesense server safely — collections are namespaced by a prefix.
🔭 Scope
v1 accelerates discussion full-text search — the primary forum search. User and post-scoped search continue to use Flarum's database driver, and the per-model design means those can be added in a later release without disruption.
🔗 Links
MIT © Ernest Defoe — free to use, forever.