|
2 | 2 |
|
3 | 3 | All notable changes to this `laravel-elasticsearch` package will be documented in this file. |
4 | 4 |
|
| 5 | +## v5.5.0 - 2026-03-15 |
| 6 | + |
| 7 | +This release is compatible with Laravel 10, 11 & 12 |
| 8 | + |
| 9 | +[What's new in v5.5](https://elasticsearch.pdphilip.com/whats-new/#55-new-features) |
| 10 | + |
| 11 | +### New features |
| 12 | + |
| 13 | +#### Automated Re-indexing Command |
| 14 | + |
| 15 | +New `elastic:re-index` command that automates the entire re-indexing process when your field mappings change. Pass a model name and the command handles the rest — creating a temp index, copying data, verifying counts, swapping, and cleaning up across 9 interactive phases with confirmation prompts between each step. - [Docs](https://elasticsearch.pdphilip.com/schema/artisan-commands/#elasticre-index) |
| 16 | + |
| 17 | +```bash |
| 18 | +php artisan elastic:re-index UserLog |
| 19 | +php artisan elastic:re-index "App\Models\ES\UserLog" |
| 20 | +``` |
| 21 | + |
| 22 | +Features include: |
| 23 | +- Smart mapping analysis that detects type mismatches and sub-field changes (e.g., adding `hasKeyword: true`) |
| 24 | +- Resume capability — interrupted runs pick up where they left off |
| 25 | +- Configurable tolerance and retry settings |
| 26 | +- `--force` flag to skip all confirmation prompts |
| 27 | + |
| 28 | +#### Model Scaffolding Command |
| 29 | + |
| 30 | +New `elastic:make` command to scaffold Elasticsearch models with the correct base class, connection, and a starter `mappingDefinition()`. - [Docs](https://elasticsearch.pdphilip.com/schema/artisan-commands/#elasticmake) |
| 31 | + |
| 32 | +```bash |
| 33 | +php artisan elastic:make UserLog |
| 34 | +php artisan elastic:make ES/UserLog |
| 35 | +``` |
| 36 | + |
| 37 | +#### Mapping Definition on Models |
| 38 | + |
| 39 | +Define your index field mappings directly on the model by overriding `mappingDefinition()`. Uses the same Blueprint syntax as migrations. Powers the `elastic:re-index` command's mapping analysis. - [Docs](https://elasticsearch.pdphilip.com/eloquent/the-base-model/#mapping-definition) |
| 40 | + |
| 41 | +```php |
| 42 | +public static function mappingDefinition(Blueprint $index): void |
| 43 | +{ |
| 44 | + $index->keyword('status'); |
| 45 | + $index->text('title', hasKeyword: true); |
| 46 | + $index->geoPoint('location'); |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +#### Artisan Commands Reference |
| 51 | + |
| 52 | +All five Artisan commands (`elastic:status`, `elastic:indices`, `elastic:show`, `elastic:make`, `elastic:re-index`) are now documented on a dedicated page. - [Docs](https://elasticsearch.pdphilip.com/schema/artisan-commands) |
| 53 | + |
| 54 | +### Fixed |
| 55 | + |
| 56 | +- `whereNestedObject()` and `filterNested()` no longer leak `parentField` into the parent query builder. The nested path was being set on `$this` instead of the sub-query, causing it to persist across subsequent queries on the same builder. |
| 57 | + |
| 58 | +**Full Changelog**: https://github.com/pdphilip/laravel-elasticsearch/compare/v5.4.1...v5.5.0 |
| 59 | + |
5 | 60 | ## v5.4.1 - 2026-02-23 |
6 | 61 |
|
7 | 62 | ### Fixed |
|
0 commit comments