diff --git a/docs/commands.md b/docs/commands.md index fae5737..21debb5 100755 --- a/docs/commands.md +++ b/docs/commands.md @@ -1,23 +1,34 @@ # Console commands ## Create + +Use Laravel Scout import command to create and update indices. + +``` +php artisan scout:import ``` -php artisan elastic:create + +For example, if your model is "App\Models\Post.php" then command would be like this: + +```php +php artisan scout:import "App\Models\Post.php" ``` -Creates all indices. -Throws an exception if one already exists. If you want to recreate an index, first make sure it's deleted and then create it. Follow up with a scout import to refill the index as well. ## Delete + ``` -php artisan elastic:delete +php artisan scout:delete-index ``` -Deletes all indices. + +Use Laravel Scount delete-index command to delete the indices. ## Search + ``` php artisan elastic:search --fields= ``` + Rudimentary command to test a basic search query. diff --git a/docs/quickstart.md b/docs/quickstart.md index 0dc658e..d33c7f1 100755 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -173,7 +173,7 @@ After that, you can define your first index in config/elasticvision.php: ] ``` -Upon saving the file, run `php artisan elastic:create` to create this index, and `php artisan scout:import "App\Models\Post"` to add your posts as documents to the index. +Upon saving the file, run `php artisan scout:import "App\Models\Post"` to add your posts as documents to the index. This of course assumes that you have a Post model (with an ID and title attribute) and a couple of entries of them in your database. As mentioned before, Laravel Scout also has a few requirements explained in its documentation for your models.