Skip to content

Artisan CLI Tools

ElasticLens provides a set of Artisan commands to manage and monitor your indexes.

Overall Indexes Status

Terminal window
php artisan lens:status

Displays the overall status of all your indexes and the ElasticLens configuration.

ElasticLens Build

Index Health

Terminal window
php artisan lens:health User
ElasticLens Build

Provides a comprehensive state of a specific index, in this case, for the User model.

Migrate and Build/Rebuild an Index

Terminal window
php artisan lens:migrate User

Deletes the existing User index, runs the migration, and rebuilds all records.

ElasticLens Migrate

Create a new Index Model

Terminal window
php artisan lens:make Profile

Generates a new index for the Profile model.

ElasticLens Build

Bulk (re)build indexes:

Terminal window
php artisan lens:build Profile

Rebuilds all the IndexedProfile records for the Profile model.

ElasticLens Build