PHPackages                             blomstra/search - 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. blomstra/search

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

blomstra/search
===============

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

0.2.0(2mo ago)125.3k↓50%9[6 issues](https://github.com/blomstra/flarum-ext-search/issues)[1 PRs](https://github.com/blomstra/flarum-ext-search/pulls)MITPHPPHP &gt;= 8.0CI passing

Since Oct 20Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/blomstra/flarum-ext-search)[ Packagist](https://packagist.org/packages/blomstra/search)[ RSS](/packages/blomstra-search/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (51)Used By (0)

[![](https://camo.githubusercontent.com/382554db94725f81fd9597c208dcf2901a822f7f9065bbc3449716f1727ad879/68747470733a2f2f6578746976657273652e636f6d2f657874656e73696f6e2f626c6f6d737472612f7365617263682f6f70656e2d67726170682d696d616765)](https://camo.githubusercontent.com/382554db94725f81fd9597c208dcf2901a822f7f9065bbc3449716f1727ad879/68747470733a2f2f6578746976657273652e636f6d2f657874656e73696f6e2f626c6f6d737472612f7365617263682f6f70656e2d67726170682d696d616765)

Search replaces the native Flarum search functionality which relies on MySQL badly performing fulltext search with one that is completely relying on the proven elasticsearch engine.

Features
--------

[](#features)

- Sync discussions and posts to Elasticsearch using your queue, unobtrusively for the user.
- Reduces search loading times to well below 400ms (local tests with 50,000 discussions: **260ms**)
- Uses Flarum's group permissions and tags system.
- Compatible with Friends of Flarum Byōbu.

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

[](#requirements)

- Elasticsearch 7.x or OpenSearch 1.x+
- A non-sync queue driver with a running worker (`php flarum queue:work`) is strongly recommended for production. The extension works with the default sync driver, but index jobs run inline which adds latency to user-facing changes like posting.

Installation
------------

[](#installation)

```
composer require blomstra/search:*
```

Enable the extension in the admin area and configure the Elasticsearch endpoint and index name in the extension settings.

Setting up the index
--------------------

[](#setting-up-the-index)

### First install

[](#first-install)

Run the build command once. It creates a timestamped concrete index, immediately aliases your configured index name to it, and begins queuing documents. Search is available and improves as the queue processes:

```
php flarum blomstra:search:index build
php flarum queue:work
```

### Subsequent rebuilds (zero-downtime)

[](#subsequent-rebuilds-zero-downtime)

When you need to rebuild the full index (e.g. after a mapping change):

```
# Simple rebuild — promotes automatically once all jobs are queued
php flarum blomstra:search:index build

# Or keep a backup of the old index in case you need to roll back
php flarum blomstra:search:index build --keep-backup
```

After the queue drains, fill any gaps from content posted during the build:

```
php flarum blomstra:search:index fill
```

If you kept a backup and want to roll back:

```
php flarum blomstra:search:index rollback
```

Once satisfied with the new index, drop the backup:

```
php flarum blomstra:search:index discard --backup
```

### Blue-green rebuild (manual promotion)

[](#blue-green-rebuild-manual-promotion)

Use `--staging` to keep the old index live until you explicitly promote:

```
# 1. Build into a staging index — live index is untouched
php flarum blomstra:search:index build --staging

# 2. Drain the queue
php flarum queue:work --stop-when-empty

# 3. Promote the staging index to live
php flarum blomstra:search:index promote
# Or keep the old index as a backup:
php flarum blomstra:search:index promote --keep-backup
```

### Resuming or cancelling an interrupted build

[](#resuming-or-cancelling-an-interrupted-build)

If a build is interrupted, re-run it with the appropriate flag:

```
# Resume each seeder from where it left off
php flarum blomstra:search:index build --resume

# Drop the staging index and start completely fresh
php flarum blomstra:search:index build --fresh

# Cancel the build without starting a new one
php flarum blomstra:search:index discard --pending
```

### Filling gaps in an existing index

[](#filling-gaps-in-an-existing-index)

If documents are missing from the live index (e.g. due to queue failures):

```
php flarum blomstra:search:index fill
```

### Updating the mapping only

[](#updating-the-mapping-only)

To push a mapping change to the live index without rebuilding:

```
php flarum blomstra:search:index mapping
```

Command reference
-----------------

[](#command-reference)

CommandDescription`build`Rebuild the index and promote automatically once all jobs are queued. On first install, aliases immediately so search is live during seeding.`build --keep-backup`Rebuild and promote, retaining the old index as a backup for rollback.`build --staging`Build into a staging index without promoting — use `promote` when ready (blue-green workflow).`build --resume`Resume an interrupted build from where each seeder left off.`build --fresh`Drop the staging index and start completely fresh.`promote`Atomically swap the alias to the staging index. Prompts for confirmation (blue-green workflow).`promote --keep-backup`Promote and retain the replaced live index as a backup for rollback.`rollback`Restore the backup index to live. Deletes the index that was live.`discard --pending`Drop the staging index without promoting (cancels an in-progress build).`discard --backup`Drop the backup index (cleanup after `--keep-backup`).`mapping`Push updated mapping to the live index without rebuilding or reseeding.`fill`Seed only documents missing from the live index.`build --only=discussions`Seed only the specified document type (`discussions` or `posts`).`build --throttle=N`Wait N seconds between batches (reduces queue pressure).`build --max-id=N`Limit seeding to documents with ID ≤ N.`promote --i-am-sure`Skip the promotion confirmation prompt (for scripts and CI).FAQ
---

[](#faq)

Queue configuration
-------------------

[](#queue-configuration)

*"Can I dispatch indexing jobs to a specific queue?"*

Yes:

```
\Blomstra\Search\Jobs\Job::$onQueue = 'search';
```

*"I have a different question"*

Reach out ot us via  . If you have an active subscription, please mention what plan you are on.

---

- Floxum provides managed Flarum hosting.
-
-

Icon made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com/).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance78

Regular maintenance activity

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.7% 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 ~40 days

Recently: every ~309 days

Total

42

Last Release

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/504687?v=4)[Daniël Klabbers](/maintainers/Luceos)[@luceos](https://github.com/luceos)

---

Top Contributors

[![luceos](https://avatars.githubusercontent.com/u/504687?v=4)](https://github.com/luceos "luceos (90 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (17 commits)")[![davwheat](https://avatars.githubusercontent.com/u/7406822?v=4)](https://github.com/davwheat "davwheat (12 commits)")[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (11 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (6 commits)")[![rob006](https://avatars.githubusercontent.com/u/5972388?v=4)](https://github.com/rob006 "rob006 (1 commits)")

---

Tags

searchelasticsearchelasticextensionfulltextflarumblomstra

### Embed Badge

![Health badge](/badges/blomstra-search/health.svg)

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

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399672.8k](/packages/jeroen-g-explorer)[flarum-lang/russian

Russian language pack for Flarum.

12128.3k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1938.7k](/packages/flarum-lang-french)

PHPackages © 2026

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