- Switch to ES parent/child join_field: discussion docs hold all metadata, post docs hold content only. Routing ensures parent and child land on the same shard. Removes the old flat-document approach where post data was duplicated onto every comment document. - Add HasChildQuery with inner_hits so the best-matching post ID is surfaced as mostRelevantPost without a second DB query. - Blue-green index rebuilds: --recreate writes into a timestamped pending index, --swap atomically promotes it via alias. Interrupted builds are resumable with --recreate --continue. --swap requires confirmation before proceeding. - Index hidden posts; non-moderators are filtered at query time via is_hidden on the has_child clause. Core\Hidden and Core\Restored trigger re-indexing so moderators with post.hide can search hidden posts. |
||
|---|---|---|
| .github/workflows | ||
| js | ||
| resources | ||
| src | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE.md | ||
| README.md | ||
| composer.json | ||
| extend.php | ||
README.md
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
- Sync discussions to elastic search using your queue, unobtrusively for the user.
- Reduces search loading times to well below 400ms (local tests with 50.000 discussion 260ms)
- Uses Flarum's group permissions and tags system.
- Compatible with Friends of Flarum Byōbu.
Installation
Use composer:
composer require blomstra/search:*
Enable the extension inside the admin area and configure the settings.
Set up
Enable the extension in your admin area. Now to seed your existing discussions use the following command:
php flarum blomstra:search:index
All mutations to discussions are automatically added and removed from the elasticsearch index.
FAQ
I have another question. Reach out to us via https://helpdesk.blomstra.net. We will get back to you as soon as we can. If you have a running subscription please mention when you started your plan and/or which plan you are on. Always add sufficient information when reporting errors. We prefer errors being reported here, but understand that sometimes you can't.
Can I dispatch the sync jobs to another queue? Yes:
\Blomstra\Search\Observe\Job::$onQueue = 'sync';
- Blomstra provides managed Flarum hosting.
- https://blomstra.net
- https://blomstra.community/t/ext-search