PHPackages                             ernestdefoe/typesense - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. ernestdefoe/typesense

ActiveFlarum-extension[Search &amp; Filtering](/categories/search)

ernestdefoe/typesense
=====================

Fast, typo-tolerant Typesense search for Flarum 2 — a free, drop-in search driver.

v0.2.1(1mo ago)047MITPHPPHP ^8.2CI passing

Since Jul 2Pushed 1mo agoCompare

[ Source](https://github.com/ernestdefoe/typesense)[ Packagist](https://packagist.org/packages/ernestdefoe/typesense)[ RSS](/packages/ernestdefoe-typesense/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

Typesense Search for Flarum
===========================

[](#typesense-search-for-flarum)

[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE.md)

A free, drop-in [Typesense](https://typesense.org) search driver for **Flarum 2** — fast, typo-tolerant full-text search across **discussions, users and posts** that anyone can set up in a few minutes.

Flarum 2 shipped a pluggable search architecture; 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. You choose per resource which searches Typesense answers.

Why it's safe by design
-----------------------

[](#why-its-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, and the browser never talks to it. Your API key is stored server-side and is never exposed to visitors.

Requirements
------------

[](#requirements)

- Flarum `^2.0`
- A running Typesense server (self-hosted is a single binary or Docker container, or use Typesense Cloud)

Install
-------

[](#install)

```
composer require ernestdefoe/typesense
```

### Run Typesense (self-hosted example)

[](#run-typesense-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
```

Set up
------

[](#set-up)

1. **Admin → Typesense Search.** Enter the host, port, protocol and API key, then **Save**.
2. Click **Test connection** to confirm Flarum can reach the server.
3. Click **Rebuild index** (or run `php flarum typesense:index`) to populate the index from your existing discussions.
4. Turn on **Use Typesense for discussion search** and save.

That's it — searches for discussions are now served by Typesense.

Search tabs that Typesense answers show a small **Powered by Typesense** badge in the search modal, so you can see at a glance which searches are using the driver. Only that on/off fact is sent to the browser — connection details and the API key stay on the server.

### Console

[](#console)

```
php flarum typesense:index          # build / refresh the index
php flarum typesense:index --flush  # delete the index
```

How indexing works
------------------

[](#how-indexing-works)

- Each discussion is one Typesense document: its title plus the concatenated text of its visible comment posts.
- Creating, editing or deleting a discussion or post re-indexes the affected discussion automatically through Flarum's queued indexing pipeline.
- **Configure a real queue driver** (`redis`, `database`, …) in production so indexing and rebuilds run in the background rather than inline on a web request.

Several forums can share one Typesense server safely — collections are namespaced by a prefix (set one, or it's derived from your forum URL).

What's indexed
--------------

[](#whats-indexed)

Everything Flarum can full-text search, each in its own namespaced collection:

- **Discussions** — title + the concatenated text of visible comment posts.
- **Users** — username and display name.
- **Posts** — individual comment post text (post-scoped search).

Each is toggled independently in the admin, so you can send discussion search to Typesense while leaving users or posts on the database, or run all three through it. (Groups and access tokens have no full-text search in Flarum, so they always stay on the database driver.)

License
-------

[](#license)

[MIT](./LICENSE.md) © Ernest Defoe

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9978664264055711c21fbcf73c937f758df771d9cb40f6a25370b10123e7abc?d=identicon)[ernestdefoe](/maintainers/ernestdefoe)

---

Top Contributors

[![ernestdefoe](https://avatars.githubusercontent.com/u/24905286?v=4)](https://github.com/ernestdefoe "ernestdefoe (4 commits)")

---

Tags

searchfulltextflarumtypesense

### Embed Badge

![Health badge](/badges/ernestdefoe-typesense/health.svg)

```
[![Health](https://phpackages.com/badges/ernestdefoe-typesense/health.svg)](https://phpackages.com/packages/ernestdefoe-typesense)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M236](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[flarum-lang/russian

Russian language pack for Flarum.

13129.1k](/packages/flarum-lang-russian)[sproutcms/cms

Enterprise content management and framework

243.0k4](/packages/sproutcms-cms)[blomstra/search

Replaces Flarum search with one powered by an elastic search server.

125.4k](/packages/blomstra-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
