]> BookStack Code Mirror - bookstack/blob - app/Console/Commands/RegenerateSearch.php
Started implementation of new search system
[bookstack] / app / Console / Commands / RegenerateSearch.php
1 <?php
2
3 namespace BookStack\Console\Commands;
4
5 use BookStack\Services\SearchService;
6 use Illuminate\Console\Command;
7
8 class RegenerateSearch extends Command
9 {
10     /**
11      * The name and signature of the console command.
12      *
13      * @var string
14      */
15     protected $signature = 'bookstack:regenerate-search';
16
17     /**
18      * The console command description.
19      *
20      * @var string
21      */
22     protected $description = 'Command description';
23
24     protected $searchService;
25
26     /**
27      * Create a new command instance.
28      *
29      * @param SearchService $searchService
30      */
31     public function __construct(SearchService $searchService)
32     {
33         parent::__construct();
34         $this->searchService = $searchService;
35     }
36
37     /**
38      * Execute the console command.
39      *
40      * @return mixed
41      */
42     public function handle()
43     {
44         $this->searchService->indexAllEntities();
45     }
46 }