diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed9868..9658093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## 5.0.6 - 2025-06-02 +### Fixed +- Fixed an issue when Craft Commerce was installed but not enabled ([#368](https://github.com/studioespresso/craft-scout/issues/368)) + +### Added +- Importing indexes with multiple element types now echo the element count for each type ([#366](https://github.com/studioespresso/craft-scout/issues/366)) + ## 5.0.5 - 2025-03-28 ### Fixed - Fix regression when indexRelations is false ([#364](https://github.com/studioespresso/craft-scout/pull/364)) diff --git a/composer.json b/composer.json index fc4f000..36f9767 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "studioespresso/craft-scout", "description": "Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.", "type": "craft-plugin", - "version": "5.0.5", + "version": "5.0.6", "keywords": [ "craft", "cms", @@ -53,7 +53,8 @@ "scripts": { "check-cs": "ecs check --ansi", "fix-cs": "ecs check --ansi --fix", - "phpstan": "phpstan --memory-limit=1G" + "phpstan": "phpstan --memory-limit=1G", + "ci": "ecs check --ansi --fix && phpstan --memory-limit=1G" }, "autoload": { "psr-4": { diff --git a/src/console/controllers/scout/IndexController.php b/src/console/controllers/scout/IndexController.php index b1ead04..e6e2a94 100644 --- a/src/console/controllers/scout/IndexController.php +++ b/src/console/controllers/scout/IndexController.php @@ -74,12 +74,17 @@ public function actionImport($index = '') $elementsUpdated = 0; foreach ($engine->scoutIndex->criteria as $query) { + $totalElements = $query->count(); + $elementsUpdated = 0; $batch = $query->batch( Scout::$plugin->getSettings()->batch_size ); + foreach ($batch as $elements) { $engine->update($elements); + $elementsUpdated += count($elements); + $this->stdout("Updated {$elementsUpdated}/{$totalElements} element(s) ({$query->elementType}) in {$engine->scoutIndex->indexName}\n", Console::FG_GREEN); } } } else {