From b70576d504fd5722474cefc1600d775d362045b1 Mon Sep 17 00:00:00 2001 From: edalzell Date: Thu, 21 Feb 2019 22:14:14 -0800 Subject: [PATCH] Update all search indexes --- PowerTools/PowerToolsController.php | 14 +++++++++----- PowerTools/meta.yaml | 4 ++-- PowerTools/resources/views/widget.blade.php | 2 +- PowerTools/routes.yaml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/PowerTools/PowerToolsController.php b/PowerTools/PowerToolsController.php index 8d87399..39d913e 100755 --- a/PowerTools/PowerToolsController.php +++ b/PowerTools/PowerToolsController.php @@ -78,15 +78,19 @@ private function getPHPInfo() } /** - * Rebuild the search index + * Rebuild the search indexes * @return \Illuminate\Http\RedirectResponse */ - public function rebuildSearchIndex() + public function rebuildSearchIndexes() { return $this->doThing( - function () { Artisan::call('search:update'); }, - 'Search index rebuilt successfully', - 'Problem rebuilding your search index' + function () { + Search::indexes()->each(function ($index, $key) { + Search::update($key); + }); + }, + 'Search indexes rebuilt successfully', + 'Problem rebuilding your search indexes' ); } diff --git a/PowerTools/meta.yaml b/PowerTools/meta.yaml index af19ded..d0821c4 100755 --- a/PowerTools/meta.yaml +++ b/PowerTools/meta.yaml @@ -1,6 +1,6 @@ name: PowerTools -version: 1.6.4 -description: Rebuild your search index, cache & asset presets, see your PHP Info and your log +version: 1.6.5 +description: Rebuild your search indexes, cache & asset presets, see your PHP Info and your log url: https://github.com/edalzell/statamic-powertools developer: Erin Dalzell developer_url: https://github.com/edalzell diff --git a/PowerTools/resources/views/widget.blade.php b/PowerTools/resources/views/widget.blade.php index b844ae3..de58971 100755 --- a/PowerTools/resources/views/widget.blade.php +++ b/PowerTools/resources/views/widget.blade.php @@ -20,7 +20,7 @@
diff --git a/PowerTools/routes.yaml b/PowerTools/routes.yaml index 6e6837d..5ee612e 100755 --- a/PowerTools/routes.yaml +++ b/PowerTools/routes.yaml @@ -9,7 +9,7 @@ routes: as: logs /rebuild-search: - uses: rebuildSearchIndex + uses: rebuildSearchIndexes as: powertools.rebuild-search /clear-cache: