X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/919660678bec2b94eaa84ac60d0313f5ef07dfb7..refs/pull/2023/head:/app/Console/Commands/RegenerateSearch.php diff --git a/app/Console/Commands/RegenerateSearch.php b/app/Console/Commands/RegenerateSearch.php index d27d73edc..dc57f2cea 100644 --- a/app/Console/Commands/RegenerateSearch.php +++ b/app/Console/Commands/RegenerateSearch.php @@ -3,6 +3,7 @@ namespace BookStack\Console\Commands; use BookStack\Entities\SearchService; +use DB; use Illuminate\Console\Command; class RegenerateSearch extends Command @@ -26,7 +27,7 @@ class RegenerateSearch extends Command /** * Create a new command instance. * - * @param \BookStack\Entities\SearchService $searchService + * @param SearchService $searchService */ public function __construct(SearchService $searchService) { @@ -41,14 +42,14 @@ class RegenerateSearch extends Command */ public function handle() { - $connection = \DB::getDefaultConnection(); + $connection = DB::getDefaultConnection(); if ($this->option('database') !== null) { - \DB::setDefaultConnection($this->option('database')); - $this->searchService->setConnection(\DB::connection($this->option('database'))); + DB::setDefaultConnection($this->option('database')); + $this->searchService->setConnection(DB::connection($this->option('database'))); } $this->searchService->indexAllEntities(); - \DB::setDefaultConnection($connection); + DB::setDefaultConnection($connection); $this->comment('Search index regenerated'); } }