moaines / illumi-search
Plug-and-play full-text search for Laravel — SQLite FTS5, MySQL FULLTEXT, PostgreSQL tsvector, FileEngine. Same API, zero config. BM25 ranking, CJK/RTL, boolean operators, spellcheck, multi-tenant, REST API. 810 tests, 4 engines.
Requires
- php: ^8.1
- ext-mbstring: *
- illuminate/database: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- meilisearch/meilisearch-php: ^1.16
- symfony/string: ^7.0 || ^8.0
Requires (Dev)
- filament/filament: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
- php-debugbar/php-debugbar: ^2.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.5
- wamania/php-stemmer: ^4.0
Suggests
- ext-intl: Required for advanced Unicode normalization and CJK tokenization. Without it, a fallback processor using symfony/string is used.
- ext-pcntl: Required for concurrent chunk processing in FileEngine. Without it, falls back to sequential processing (still functional, just slower).
- ext-sqlite3: Required for the SQLite FTS5 engine (default). Without it, use mysql, pgsql, or file driver.
- wamania/php-stemmer: Required for the StemmingTextProcessor. Install if you set ILLUMI_SEARCH_PROCESSOR=stemming.
This package is auto-updated.
Last update: 2026-08-13 16:46:48 UTC
README
Write search code once. Switch engines by changing one .env value.
Laravel full-text search with your choice of backends — SQLite, MySQL, PostgreSQL, FileEngine, Meilisearch. Same API, same operators, same 966 tests validating cross-engine consistency. Use your app's own database (SQLite, MySQL, PostgreSQL — zero extra infrastructure) or add a dedicated search server (Meilisearch — instant typo tolerance).
Full documentation: illumi-search-documentation — quick start, configuration, query builder, advanced features, tenancy, custom engines, testing, and a full capacity benchmark report.
Why not just Laravel's native
whereFullText? Laravel's built-in full-text search covers basicMATCH/AGAINST(MySQL) andto_tsvector(PostgreSQL) — but it has no SQLite FTS5 support, no boolean query language, and no spellcheck. illumi-search adds a full operator set (AND/OR/NOT/NEAR/phrase/wildcard), spellcheck, CJK/RTL handling, faceted search, and cross-engine consistency.
Quick Start (30 seconds)
composer require moaines/illumi-search
// 1. Add the trait to your model class Post extends Model { use Moaines\IllumiSearch\Searchable; protected array $searchable = ['title', 'body']; } // 2. Build the index // php artisan illumi-search:rebuild // 3. Search use Moaines\IllumiSearch\Facades\IllumiSearch; $results = IllumiSearch::query('laravel')->get(); // simple $results = IllumiSearch::query('php AND laravel')->get(); // boolean $results = IllumiSearch::query('"design patterns"')->get(); // phrase $results = IllumiSearch::query('prog*')->get(); // prefix wildcard
Engines at a glance
| Engine | ILLUMI_SEARCH_DRIVER |
Best for |
|---|---|---|
| SQLite FTS5 | sqlite (default) |
Zero config — shops < 50k items, admin panels, intranets |
| PostgreSQL | pgsql |
Multi-language, > 500k docs, best perf/scale |
| MySQL FULLTEXT | mysql |
Existing MySQL projects, Latin content, ~500k docs |
| FileEngine | file |
Serverless, embedded, no-DB, up to 1M+ docs |
| Meilisearch | meilisearch |
Dedicated search server, typo-tolerant, millions of docs |
Switch engines by changing .env — your application code never changes.
Features
Boolean operators (AND/OR/NOT/NEAR) · phrase · prefix wildcard ·
spellcheck · CJK/RTL · accent-insensitive · stopwords (7 languages) ·
multi-tenant · authorization · REST API · <mark> snippets · faceted search ·
aggregations · recency/popularity boost · search cache · Filament integration.
Performance
Standard benchmark at 1,000 docs (see 11 — Capacity Benchmark for volume/resource-trend data).
| Metric | SQLite | FileEngine | MySQL | PostgreSQL | Meilisearch |
|---|---|---|---|---|---|
| Search (exact) | 353 q/s | 48 q/s | 150 q/s | 123 q/s | 218 q/s |
| Latency p50 | 2.4 ms | 14.8 ms | 5.5 ms | 8.1 ms | 4.4 ms |
| NDCG@5 | 0.89 | 0.88 | 0.88 | 0.90 | 0.99 |
Full capacity report (per-volume limits, cold vs warm PostgreSQL, podman 1/2/8 GiB container tiers): 11 — Capacity Benchmark.
Testing
phpunit # 966 tests, ~1978 assertions php artisan illumi-search:benchmark # performance + quality composer analyse # PHPStan level 6
License
MIT