namespace BookStack\Console\Commands;
-use BookStack\Services\SearchService;
+use BookStack\Entities\SearchService;
use Illuminate\Console\Command;
class RegenerateSearch extends Command
*
* @var string
*/
- protected $description = 'Command description';
+ protected $description = 'Re-index all content for searching';
protected $searchService;
/**
* Create a new command instance.
*
- * @param SearchService $searchService
+ * @param \BookStack\Entities\SearchService $searchService
*/
public function __construct(SearchService $searchService)
{
$connection = \DB::getDefaultConnection();
if ($this->option('database') !== null) {
\DB::setDefaultConnection($this->option('database'));
+ $this->searchService->setConnection(\DB::connection($this->option('database')));
}
$this->searchService->indexAllEntities();