-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5c0c23
commit 5522dd9
Showing
2 changed files
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
# Console commands | ||
|
||
## Create | ||
|
||
Use Laravel Scout import command to create and update indices. | ||
|
||
``` | ||
php artisan scout:import <model> | ||
``` | ||
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 <model> | ||
``` | ||
Deletes all indices. | ||
|
||
Use Laravel Scount delete-index command to delete the indices. | ||
|
||
## Search | ||
|
||
``` | ||
php artisan elastic:search <model> <term> --fields=<fields> | ||
``` | ||
|
||
Rudimentary command to test a basic search query. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters