From df7ea9b3f535506dfa3e4142a3b863479bcc6d79 Mon Sep 17 00:00:00 2001 From: Vadym Honcharuk Date: Mon, 25 Nov 2024 15:13:20 +0200 Subject: [PATCH 1/5] [Core] Feature #3432, add the Healthcheck Page --- .../Api/Healthcheck/CheckInterface.php | 56 ++++++ .../Adminhtml/Healthcheck/Healthcheck.php | 61 ++++++ .../Adminhtml/Healthcheck/Index.php | 42 ++++ .../Model/Healthcheck/GhostIndicesCheck.php | 164 +++++++++++++++ .../Model/Healthcheck/HealthcheckList.php | 59 ++++++ .../Model/Healthcheck/ReplicasConfigCheck.php | 165 +++++++++++++++ .../Model/Healthcheck/ShardsConfigCheck.php | 190 ++++++++++++++++++ .../Message/GenericHealthcheckWarning.php | 124 ++++++++++++ .../WarningAboutClusterReplicasMisconfig.php | 158 --------------- src/module-elasticsuite-core/etc/acl.xml | 3 + .../etc/adminhtml/di.xml | 14 +- .../etc/adminhtml/menu.xml | 11 +- .../smile_elasticsuite_healthcheck_index.xml | 26 +++ .../templates/healthcheck/list.phtml | 41 ++++ .../adminhtml/web/css/source/_module.less | 11 + .../WarningAboutClusterGhostIndices.php | 150 -------------- .../WarningAboutClusterShardsMisconfig.php | 184 ----------------- .../etc/adminhtml/di.xml | 30 --- 18 files changed, 957 insertions(+), 532 deletions(-) create mode 100644 src/module-elasticsuite-core/Api/Healthcheck/CheckInterface.php create mode 100644 src/module-elasticsuite-core/Block/Adminhtml/Healthcheck/Healthcheck.php create mode 100644 src/module-elasticsuite-core/Controller/Adminhtml/Healthcheck/Index.php create mode 100644 src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php create mode 100644 src/module-elasticsuite-core/Model/Healthcheck/HealthcheckList.php create mode 100644 src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php create mode 100644 src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php create mode 100644 src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php delete mode 100644 src/module-elasticsuite-core/Model/System/Message/WarningAboutClusterReplicasMisconfig.php create mode 100644 src/module-elasticsuite-core/view/adminhtml/layout/smile_elasticsuite_healthcheck_index.xml create mode 100644 src/module-elasticsuite-core/view/adminhtml/templates/healthcheck/list.phtml delete mode 100644 src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterGhostIndices.php delete mode 100644 src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterShardsMisconfig.php delete mode 100644 src/module-elasticsuite-indices/etc/adminhtml/di.xml diff --git a/src/module-elasticsuite-core/Api/Healthcheck/CheckInterface.php b/src/module-elasticsuite-core/Api/Healthcheck/CheckInterface.php new file mode 100644 index 000000000..658b5b906 --- /dev/null +++ b/src/module-elasticsuite-core/Api/Healthcheck/CheckInterface.php @@ -0,0 +1,56 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Api\Healthcheck; + +/** + * Health CheckInterface. + */ +interface CheckInterface +{ + /** + * Warning status declaration. + */ + const WARNING_STATUS = 'warning'; + + /** + * Retrieve the unique identifier for the health check. + * + * @return string + */ + public function getIdentifier(): string; + + /** + * Retrieve the description of the health check. + * + * @return string + */ + public function getDescription(): string; + + /** + * Retrieve the status of the health check. + * Expected values: 'success', 'warning'. + * + * @return string + */ + public function getStatus(): string; + + /** + * Retrieve the sort order for the health check, which determines + * the display order of checks in the admin panel. + * + * @return int + */ + public function getSortOrder(): int; +} diff --git a/src/module-elasticsuite-core/Block/Adminhtml/Healthcheck/Healthcheck.php b/src/module-elasticsuite-core/Block/Adminhtml/Healthcheck/Healthcheck.php new file mode 100644 index 000000000..cb3c5f951 --- /dev/null +++ b/src/module-elasticsuite-core/Block/Adminhtml/Healthcheck/Healthcheck.php @@ -0,0 +1,61 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Block\Adminhtml\Healthcheck; + +use Magento\Backend\Block\Template; +use Magento\Backend\Block\Template\Context; +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; +use Smile\ElasticsuiteCore\Model\Healthcheck\HealthcheckList; + +/** + * Class Healthcheck. + * + * Block class for displaying Elasticsuite health checks in the Magento Admin panel. + */ +class Healthcheck extends Template +{ + /** + * HealthcheckList instance to manage and retrieve health checks. + * + * @var HealthcheckList + */ + private $healthcheckList; + + /** + * Constructor. + * + * @param Context $context Magento context object for backend blocks. + * @param HealthcheckList $healthcheckList The health check list object providing health check data. + * @param array $data Additional block data. + */ + public function __construct(Context $context, HealthcheckList $healthcheckList, array $data = []) + { + parent::__construct($context, $data); + $this->healthcheckList = $healthcheckList; + } + + /** + * Retrieve all health checks. + * + * Provides an array of health check instances, each implementing the CheckInterface, + * sorted by their specified order. + * + * @return CheckInterface[] + */ + public function getHealthchecks(): array + { + return $this->healthcheckList->getChecks(); + } +} diff --git a/src/module-elasticsuite-core/Controller/Adminhtml/Healthcheck/Index.php b/src/module-elasticsuite-core/Controller/Adminhtml/Healthcheck/Index.php new file mode 100644 index 000000000..9fffa54a9 --- /dev/null +++ b/src/module-elasticsuite-core/Controller/Adminhtml/Healthcheck/Index.php @@ -0,0 +1,42 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Controller\Adminhtml\Healthcheck; + +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\View\Result\Page; +use Smile\ElasticsuiteIndices\Controller\Adminhtml\AbstractAction; + +/** + * Class Index. + */ +class Index extends AbstractAction implements HttpGetActionInterface +{ + /** + * @inheritdoc + * + * @return Page + */ + public function execute(): Page + { + $breadMain = __('Healthcheck'); + + /** @var Page $resultPage */ + $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE); + $resultPage->getConfig()->getTitle()->prepend($breadMain); + + return $resultPage; + } +} diff --git a/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php new file mode 100644 index 000000000..deea5db57 --- /dev/null +++ b/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php @@ -0,0 +1,164 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Model\Healthcheck; + +use Exception; +use Magento\Framework\UrlInterface; +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; +use Smile\ElasticsuiteIndices\Model\IndexStatsProvider; + +/** + * Class GhostIndicesCheck. + * + * Health check to identify any ghost indices in the Elasticsearch cluster. + */ +class GhostIndicesCheck implements CheckInterface +{ + /** + * Route to Elasticsuite -> Indices page. + */ + private const ROUTE_ELASTICSUITE_INDICES = 'smile_elasticsuite_indices'; + + public const GHOST_STATUS = 'ghost'; + + /** + * @var IndexStatsProvider + */ + private $indexStatsProvider; + + /** + * @var UrlInterface + */ + private $urlBuilder; + + /** + * Constructor. + * + * @param IndexStatsProvider $indexStatsProvider Index stats provider. + * @param UrlInterface $urlBuilder URL builder. + */ + public function __construct( + IndexStatsProvider $indexStatsProvider, + UrlInterface $urlBuilder + ) { + $this->indexStatsProvider = $indexStatsProvider; + $this->urlBuilder = $urlBuilder; + } + + /** + * Retrieve the unique identifier for this health check. + * + * @return string + */ + public function getIdentifier(): string + { + return 'ghost_indices_check'; + } + + /** + * Retrieve a brief description of this health check. + * + * @return string + * @throws Exception + */ + public function getDescription(): string + { + $ghostCount = $this->getNumberOfGhostIndices(); + + if ($ghostCount > 0) { + // Description when ghost indices are found. + // @codingStandardsIgnoreStart + return __( + 'You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. ' + . 'You should consider removing them.
' + . 'Click here to go to the Elasticsuite Indices page to take appropriate actions.', + $ghostCount, + $this->getElasticsuiteIndicesUrl() + ); + // @codingStandardsIgnoreEnd + } + + // Description when no ghost indices are found. + return __('There are no ghost indexes in your Elasticsearch cluster. No action is required at this time.'); + } + + /** + * Retrieve the status of this health check. + * Returns 'warning' if ghost indices are found, otherwise 'success'. + * + * @return string + * @throws Exception + */ + public function getStatus(): string + { + return $this->hasGhostIndices() ? 'warning' : 'success'; + } + + /** + * Retrieve the sort order for this health check. + * + * @return int + */ + public function getSortOrder(): int + { + return 10; // Adjust as necessary. + } + + /** + * Checks if there are any ghost indices. + * + * @return bool + * @throws Exception + */ + private function hasGhostIndices(): bool + { + return $this->getNumberOfGhostIndices() > 0; + } + + /** + * Get number of ghost Elasticsuite indices. + * + * @return int + * @throws Exception + */ + private function getNumberOfGhostIndices(): int + { + $ghostIndices = 0; + $elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices(); + + if ($elasticsuiteIndices !== null) { + foreach ($elasticsuiteIndices as $indexName => $indexAlias) { + $indexData = $this->indexStatsProvider->indexStats($indexName, $indexAlias); + + if (array_key_exists('index_status', $indexData) + && $indexData['index_status'] === self::GHOST_STATUS) { + $ghostIndices++; + } + } + } + + return $ghostIndices; + } + + /** + * Retrieve a URL to the Elasticsuite Indices page for more information. + * + * @return string + */ + private function getElasticsuiteIndicesUrl(): string + { + return $this->urlBuilder->getUrl(self::ROUTE_ELASTICSUITE_INDICES); + } +} diff --git a/src/module-elasticsuite-core/Model/Healthcheck/HealthcheckList.php b/src/module-elasticsuite-core/Model/Healthcheck/HealthcheckList.php new file mode 100644 index 000000000..66db18651 --- /dev/null +++ b/src/module-elasticsuite-core/Model/Healthcheck/HealthcheckList.php @@ -0,0 +1,59 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Model\Healthcheck; + +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; + +/** + * Class HealthcheckList. + * + * Manages a list of health checks for the Elasticsuite module. + */ +class HealthcheckList +{ + /** + * Array of health checks implementing the CheckInterface. + * + * @var CheckInterface[] + */ + private $checks; + + /** + * Constructor. + * + * @param CheckInterface[] $checks Array of health checks to be managed by this list. + */ + public function __construct(array $checks = []) + { + $this->checks = $checks; + } + + /** + * Retrieve all health checks, sorted by their sort order. + * + * Sorts the checks based on the value returned by each check's `getSortOrder` method. + * + * @return CheckInterface[] Array of health checks sorted by order. + * @SuppressWarnings(PHPMD.ShortVariable) + */ + public function getChecks(): array + { + usort($this->checks, function (CheckInterface $a, CheckInterface $b) { + return $a->getSortOrder() <=> $b->getSortOrder(); + }); + + return $this->checks; + } +} diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php new file mode 100644 index 000000000..344d9aa9b --- /dev/null +++ b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php @@ -0,0 +1,165 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Model\Healthcheck; + +use Magento\Framework\UrlInterface; +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; +use Smile\ElasticsuiteCore\Helper\IndexSettings as IndexSettingsHelper; +use Smile\ElasticsuiteCore\Client\Client; + +/** + * Class ReplicasConfigCheck. + * + * Health check for replicas misconfiguration in Elasticsuite. + */ +class ReplicasConfigCheck implements CheckInterface +{ + /** + * Route to Stores -> Configuration section. + */ + private const ROUTE_SYSTEM_CONFIG = 'adminhtml/system_config/edit'; + + /** + * Anchor for Stores -> Configuration -> ELASTICSUITE -> Base Settings -> Indices Settings. + */ + private const ANCHOR_ES_INDICES_SETTINGS_PATH = 'smile_elasticsuite_core_base_settings_indices_settings-link'; + + /** + * URL for Elasticsuite Indices Settings Wiki page. + */ + private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings'; + + /** + * @var IndexSettingsHelper + */ + protected $helper; + + /** + * @var Client + */ + protected $client; + + /** + * @var UrlInterface + */ + private $urlBuilder; + + /** + * Constructor. + * + * @param IndexSettingsHelper $indexSettingHelper Index settings helper. + * @param Client $client Elasticsearch client. + * @param UrlInterface $urlBuilder URL builder. + */ + public function __construct( + IndexSettingsHelper $indexSettingHelper, + Client $client, + UrlInterface $urlBuilder + ) { + $this->helper = $indexSettingHelper; + $this->client = $client; + $this->urlBuilder = $urlBuilder; + } + + /** + * Retrieve the unique identifier for this health check. + * + * @return string + */ + public function getIdentifier(): string + { + return 'replicas_config_check'; + } + + /** + * Retrieve a dynamic description for this health check based on its status. + * + * @return string + */ + public function getDescription(): string + { + $status = $this->getStatus(); + + if ($status === CheckInterface::WARNING_STATUS) { + // Description when the replicas configuration is incorrect. + // @codingStandardsIgnoreStart + return __( + 'The number of replicas configured for Elasticsuite is incorrect. ' + . 'You can\'t use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.
' + . 'Click here to go to the Elasticsuite Basic Settings page and change your Number of Replicas per Index parameter according to our Wiki page.', + $this->helper->getNumberOfReplicas(), + $this->getNumberOfNodes(), + $this->getElasticsuiteConfigUrl(), + self::ES_INDICES_SETTINGS_WIKI_PAGE + ); + // @codingStandardsIgnoreEnd + } + + // Description when the replicas configuration is optimized. + return __('The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.'); + } + + /** + * Retrieve the status of this health check. + * + * @return string + */ + public function getStatus(): string + { + $numberOfReplicas = $this->helper->getNumberOfReplicas(); + $numberOfNodes = $this->getNumberOfNodes(); + + if ($numberOfReplicas > 0 && $numberOfReplicas > ($numberOfNodes - 1)) { + return 'warning'; + } + + return 'success'; + } + + /** + * Retrieve the sort order for this health check. + * + * @return int + */ + public function getSortOrder(): int + { + return 20; // Adjust as necessary. + } + + /** + * Get the number of nodes in the Elasticsearch cluster. + * + * @return int + */ + private function getNumberOfNodes(): int + { + $nodeInfo = $this->client->nodes()->info()['_nodes'] ?? []; + + return $nodeInfo['total'] ?? 0; + } + + /** + * Get URL to the admin Elasticsuite Configuration page. + * + * @return string + */ + private function getElasticsuiteConfigUrl(): string + { + return $this->urlBuilder->getUrl( + self::ROUTE_SYSTEM_CONFIG, + ['section' => 'smile_elasticsuite_core_base_settings', '_fragment' => self::ANCHOR_ES_INDICES_SETTINGS_PATH] + ); + } +} diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php new file mode 100644 index 000000000..ecc4bf6a3 --- /dev/null +++ b/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php @@ -0,0 +1,190 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Model\Healthcheck; + +use Exception; +use Magento\Framework\UrlInterface; +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; +use Smile\ElasticsuiteCore\Helper\IndexSettings as IndexSettingsHelper; +use Smile\ElasticsuiteIndices\Model\IndexStatsProvider; + +/** + * Class ShardsConfigCheck. + * + * Checks for shard misconfigurations in the Elasticsearch cluster. + */ +class ShardsConfigCheck implements CheckInterface +{ + /** + * Route to Stores -> Configuration section. + */ + private const ROUTE_SYSTEM_CONFIG = 'adminhtml/system_config/edit'; + + /** + * Anchor for Stores -> Configuration -> ELASTICSUITE -> Base Settings -> Indices Settings. + */ + private const ANCHOR_ES_INDICES_SETTINGS_PATH = 'smile_elasticsuite_core_base_settings_indices_settings-link'; + + /** + * URL for Elasticsuite Indices Settings Wiki page. + */ + private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings'; + + public const UNDEFINED_SIZE = 'N/A'; + + /** + * @var IndexSettingsHelper + */ + private $indexSettingsHelper; + + /** + * @var IndexStatsProvider + */ + private $indexStatsProvider; + + /** + * @var UrlInterface + */ + private $urlBuilder; + + /** + * Constructor. + * + * @param IndexSettingsHelper $indexSettingsHelper Index settings helper. + * @param IndexStatsProvider $indexStatsProvider Index stats provider. + * @param UrlInterface $urlBuilder URL builder. + */ + public function __construct( + IndexSettingsHelper $indexSettingsHelper, + IndexStatsProvider $indexStatsProvider, + UrlInterface $urlBuilder + ) { + $this->indexSettingsHelper = $indexSettingsHelper; + $this->indexStatsProvider = $indexStatsProvider; + $this->urlBuilder = $urlBuilder; + } + + /** + * Retrieve the unique identifier for this health check. + * + * @return string + */ + public function getIdentifier(): string + { + return 'shards_config_check'; + } + + /** + * Retrieve a dynamic description for this health check based on its status. + * + * @return string + * @throws Exception + */ + public function getDescription(): string + { + $numberOfShards = $this->indexSettingsHelper->getNumberOfShards(); + $maxIndexSize = $this->getMaxIndexSize(); + $status = $this->getStatus(); + + if ($status === CheckInterface::WARNING_STATUS) { + // Description when the shard's configuration is incorrect. + // @codingStandardsIgnoreStart + return __( + 'The number of shards configured for Elasticsuite is incorrect. ' + . 'You don\'t need to use %1 shards since your biggest Elasticsuite index is only %2.
' + . 'Click here to go to the Elasticsuite Basic Settings page and change your Number of Shards per Index parameter according to our Wiki page.', + $numberOfShards, + $maxIndexSize['human_size'], + $this->getElasticsuiteConfigUrl(), + self::ES_INDICES_SETTINGS_WIKI_PAGE + ); + // @codingStandardsIgnoreEnd + } + + // Description when the shard's configuration is optimized. + return __('The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.'); + } + + /** + * Retrieve the status of this health check. + * + * @return string + * @throws Exception + */ + public function getStatus(): string + { + $numberOfShards = $this->indexSettingsHelper->getNumberOfShards(); + $maxIndexSize = $this->getMaxIndexSize(); + + if ($numberOfShards > 1 && $maxIndexSize && $maxIndexSize['size_in_bytes'] < 10737418240) { + return 'warning'; + } + + return 'success'; + } + + /** + * Retrieve the sort order for this health check. + * + * @return int + */ + public function getSortOrder(): int + { + return 30; // Adjust as necessary. + } + + /** + * Get size of the largest Elasticsuite index. + * + * @return array|false + * @throws Exception + */ + private function getMaxIndexSize() + { + $elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices(); + $indexSizes = []; + + foreach ($elasticsuiteIndices as $indexName => $indexAlias) { + $indexData = $this->indexStatsProvider->indexStats($indexName, $indexAlias); + + if (array_key_exists('size', $indexData) && array_key_exists('size_in_bytes', $indexData) + && $indexData['size_in_bytes'] !== self::UNDEFINED_SIZE) { + $indexSizes[] = ['human_size' => $indexData['size'], 'size_in_bytes' => $indexData['size_in_bytes']]; + } + } + + if (!empty($indexSizes)) { + $indexSizesInBytes = array_column($indexSizes, "size_in_bytes"); + array_multisort($indexSizesInBytes, SORT_DESC, $indexSizes); + + return current($indexSizes); + } + + return false; + } + + /** + * Get URL to the Elasticsuite Configuration page. + * + * @return string + */ + private function getElasticsuiteConfigUrl(): string + { + return $this->urlBuilder->getUrl( + self::ROUTE_SYSTEM_CONFIG, + ['section' => 'smile_elasticsuite_core_base_settings', '_fragment' => self::ANCHOR_ES_INDICES_SETTINGS_PATH] + ); + } +} diff --git a/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php b/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php new file mode 100644 index 000000000..3372ffa0c --- /dev/null +++ b/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php @@ -0,0 +1,124 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +namespace Smile\ElasticsuiteCore\Model\System\Message; + +use Magento\Framework\UrlInterface; +use Magento\Framework\Notification\MessageInterface; +use Smile\ElasticsuiteCore\Api\Healthcheck\CheckInterface; +use Smile\ElasticsuiteCore\Model\Healthcheck\HealthcheckList; + +/** + * Class GenericWarningAboutClusterMisconfig + */ +class GenericHealthcheckWarning implements MessageInterface +{ + /** + * Route to Elasticsuite -> Healthcheck page. + */ + private const ROUTE_ELASTICSUITE_HEALTHCHECK = 'smile_elasticsuite/healthcheck/index'; + + /** + * @var HealthcheckList + */ + private $healthcheckList; + + /** + * @var UrlInterface + */ + private $urlBuilder; + + /** + * Constructor. + * + * @param HealthcheckList $healthcheckList Health check list object. + * @param UrlInterface $urlBuilder URL builder. + */ + public function __construct( + HealthcheckList $healthcheckList, + UrlInterface $urlBuilder + ) { + $this->healthcheckList = $healthcheckList; + $this->urlBuilder = $urlBuilder; + } + + /** + * {@inheritdoc} + */ + public function isDisplayed() + { + return $this->getIssueCount() > 0; + } + + /** + * {@inheritdoc} + */ + public function getIdentity() + { + return hash('sha256', 'ELASTICSUITE_GENERIC_WARNING'); + } + + /** + * {@inheritdoc} + */ + public function getSeverity() + { + return self::SEVERITY_MAJOR; + } + + /** + * {@inheritdoc} + */ + public function getText() + { + $issuesCount = $this->getIssueCount(); + + // @codingStandardsIgnoreStart + return __( + 'You have %1 health checks in a warning state. ' + . 'Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them.', + $issuesCount, + $this->getElasticsuiteHealthcheckUrl() + ); + // @codingStandardsIgnoreEnd + } + + /** + * Counts the number of health check issues in an error state. + * + * @return int + */ + private function getIssueCount(): int + { + $issuesCount = 0; + + foreach ($this->healthcheckList->getChecks() as $check) { + if ($check->getStatus() === CheckInterface::WARNING_STATUS) { + $issuesCount++; + } + } + + return $issuesCount; + } + + /** + * Retrieve a URL to the Elasticsuite Healthcheck page for more information. + * + * @return string + */ + private function getElasticsuiteHealthcheckUrl(): string + { + return $this->urlBuilder->getUrl(self::ROUTE_ELASTICSUITE_HEALTHCHECK); + } +} diff --git a/src/module-elasticsuite-core/Model/System/Message/WarningAboutClusterReplicasMisconfig.php b/src/module-elasticsuite-core/Model/System/Message/WarningAboutClusterReplicasMisconfig.php deleted file mode 100644 index d4510a9cb..000000000 --- a/src/module-elasticsuite-core/Model/System/Message/WarningAboutClusterReplicasMisconfig.php +++ /dev/null @@ -1,158 +0,0 @@ - - * @copyright 2022 Smile - * @license Open Software License ("OSL") v. 3.0 - */ - -namespace Smile\ElasticsuiteCore\Model\System\Message; - -use Magento\Framework\Notification\MessageInterface; -use Magento\Framework\UrlInterface; -use Smile\ElasticsuiteCore\Helper\IndexSettings as IndexSettingsHelper; -use Smile\ElasticsuiteCore\Client\Client; - -/** - * ElasticSuite Warning about Cluster mis-configuration for replicas - * - * @category Smile - * @package Smile\ElasticsuiteCore - * @author Vadym Honcharuk - */ -class WarningAboutClusterReplicasMisconfig implements MessageInterface -{ - /** - * Route to Stores -> Configuration section - */ - private const ROUTE_SYSTEM_CONFIG = 'adminhtml/system_config/edit'; - - /** - * Anchor for Stores -> Configuration -> ELASTICSUITE -> Base Settings -> Indices Settings - */ - private const ANCHOR_ES_INDICES_SETTINGS_PATH = 'smile_elasticsuite_core_base_settings_indices_settings-link'; - - /** - * URL for Elasticsuite Indices Settings wiki page - */ - private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings'; - - /** - * @var IndexSettingsHelper - */ - protected $helper; - - /** - * @var Client - */ - protected $client; - - /** - * @var UrlInterface - */ - private $urlBuilder; - - /** - * @param IndexSettingsHelper $indexSettingHelper Index settings helper - * @param Client $client ElasticSearch client - * @param UrlInterface $urlBuilder Url builder - */ - public function __construct( - IndexSettingsHelper $indexSettingHelper, - Client $client, - UrlInterface $urlBuilder - ) { - $this->helper = $indexSettingHelper; - $this->client = $client; - $this->urlBuilder = $urlBuilder; - } - - /** - * {@inheritdoc} - */ - public function isDisplayed() - { - if ($this->helper->getNumberOfReplicas() > 1) { - /* numberOfReplicas should be <= numberOfNodes - 1 */ - if ($this->helper->getNumberOfReplicas() <= $this->getNumberOfNodes() - 1) { - return false; - } - - return true; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getIdentity() - { - return hash('sha256', 'ELASTICSUITE_REPLICAS_WARNING'); - } - - /** - * {@inheritdoc} - */ - public function getSeverity() - { - return self::SEVERITY_MAJOR; - } - - /** - * {@inheritdoc} - */ - public function getText() - { - $messageDetails = ''; - - // @codingStandardsIgnoreStart - $messageDetails .= __( - 'The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.', - $this->helper->getNumberOfReplicas(), - $this->getNumberOfNodes() - ) . '
'; - $messageDetails .= __( - 'Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page.', - $this->getElasticsuiteConfigUrl(), - self::ES_INDICES_SETTINGS_WIKI_PAGE - ); - // @codingStandardsIgnoreEnd - - return $messageDetails; - } - - /** - * Get number of nodes from ElasticSearch client - * - * @return int - */ - public function getNumberOfNodes() - { - if (is_array($this->client->nodes()->info()['_nodes']) - && array_key_exists('total', $this->client->nodes()->info()['_nodes'])) { - return (int) $this->client->nodes()->info()['_nodes']['total']; - } - - return 0; - } - - /** - * Get URL to the admin Elasticsuite Configuration page - * - * @return string - */ - private function getElasticsuiteConfigUrl() - { - return $this->urlBuilder->getUrl( - self::ROUTE_SYSTEM_CONFIG, - ['section' => 'smile_elasticsuite_core_base_settings', '_fragment' => self::ANCHOR_ES_INDICES_SETTINGS_PATH] - ); - } -} diff --git a/src/module-elasticsuite-core/etc/acl.xml b/src/module-elasticsuite-core/etc/acl.xml index b00073241..868c2c6d8 100644 --- a/src/module-elasticsuite-core/etc/acl.xml +++ b/src/module-elasticsuite-core/etc/acl.xml @@ -31,6 +31,9 @@ + + + diff --git a/src/module-elasticsuite-core/etc/adminhtml/di.xml b/src/module-elasticsuite-core/etc/adminhtml/di.xml index 39d308f7e..9c27a577a 100644 --- a/src/module-elasticsuite-core/etc/adminhtml/di.xml +++ b/src/module-elasticsuite-core/etc/adminhtml/di.xml @@ -22,7 +22,19 @@ Smile\ElasticsuiteCore\Model\System\Message\NotificationAboutVersions - Smile\ElasticsuiteCore\Model\System\Message\WarningAboutClusterReplicasMisconfig + + Smile\ElasticsuiteCore\Model\System\Message\GenericHealthcheckWarning + + + + + + + + + Smile\ElasticsuiteCore\Model\Healthcheck\GhostIndicesCheck + Smile\ElasticsuiteCore\Model\Healthcheck\ShardsConfigCheck + Smile\ElasticsuiteCore\Model\Healthcheck\ReplicasConfigCheck diff --git a/src/module-elasticsuite-core/etc/adminhtml/menu.xml b/src/module-elasticsuite-core/etc/adminhtml/menu.xml index 3f66f7af0..86e5ef442 100644 --- a/src/module-elasticsuite-core/etc/adminhtml/menu.xml +++ b/src/module-elasticsuite-core/etc/adminhtml/menu.xml @@ -3,14 +3,7 @@ - + + diff --git a/src/module-elasticsuite-core/view/adminhtml/layout/smile_elasticsuite_healthcheck_index.xml b/src/module-elasticsuite-core/view/adminhtml/layout/smile_elasticsuite_healthcheck_index.xml new file mode 100644 index 000000000..fae89ae7f --- /dev/null +++ b/src/module-elasticsuite-core/view/adminhtml/layout/smile_elasticsuite_healthcheck_index.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/src/module-elasticsuite-core/view/adminhtml/templates/healthcheck/list.phtml b/src/module-elasticsuite-core/view/adminhtml/templates/healthcheck/list.phtml new file mode 100644 index 000000000..7add1ba8a --- /dev/null +++ b/src/module-elasticsuite-core/view/adminhtml/templates/healthcheck/list.phtml @@ -0,0 +1,41 @@ + + * @copyright 2024 Smile + * @license Open Software License ("OSL") v. 3.0 + */ + +/** @var \Smile\ElasticsuiteCore\Block\Adminhtml\Healthcheck\Healthcheck $block */ +?> + + + + + + + + + + + getHealthchecks() as $index => $check): ?> + + + + + + + +
getIdentifier() ?>getDescription() ?> + + getStatus() ?> + +
diff --git a/src/module-elasticsuite-core/view/adminhtml/web/css/source/_module.less b/src/module-elasticsuite-core/view/adminhtml/web/css/source/_module.less index a9b9f6a0e..620cca5bd 100644 --- a/src/module-elasticsuite-core/view/adminhtml/web/css/source/_module.less +++ b/src/module-elasticsuite-core/view/adminhtml/web/css/source/_module.less @@ -42,3 +42,14 @@ fieldset.radioset-tooltip { line-height: @line-height__l; } } + +.smile_elasticsuite-healthcheck-index { + .data-grid tbody tr:nth-child(odd) td { + background-color: #ffffff; /* White */ + } + + .data-grid tbody tr:nth-child(even) td { + background-color: #f5f5f5; /* Light gray */ + } +} + diff --git a/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterGhostIndices.php b/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterGhostIndices.php deleted file mode 100644 index 27de23dc7..000000000 --- a/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterGhostIndices.php +++ /dev/null @@ -1,150 +0,0 @@ - - * @copyright 2022 Smile - * @license Open Software License ("OSL") v. 3.0 - */ - -namespace Smile\ElasticsuiteIndices\Model\System\Message; - -use Magento\Framework\Notification\MessageInterface; -use Magento\Framework\UrlInterface; -use Smile\ElasticsuiteIndices\Model\IndexStatsProvider; - -/** - * ElasticSuite Warning about too much ghost indices in the cluster - * - * @category Smile - * @package Smile\ElasticsuiteIndices - * @author Vadym Honcharuk - */ -class WarningAboutClusterGhostIndices implements MessageInterface -{ - /** - * Route to Elasticsuite -> Indices page - */ - private const ROUTE_ELASTICSUITE_INDICES = 'smile_elasticsuite_indices'; - - public const GHOST_STATUS = 'ghost'; - - /** - * @var IndexStatsProvider - */ - protected $indexStatsProvider; - - /** - * @var UrlInterface - */ - private $urlBuilder; - - /** - * @param IndexStatsProvider $indexStatsProvider Index stats provider - * @param UrlInterface $urlBuilder Url builder - */ - public function __construct( - IndexStatsProvider $indexStatsProvider, - UrlInterface $urlBuilder - ) { - $this->indexStatsProvider = $indexStatsProvider; - $this->urlBuilder = $urlBuilder; - } - - /** - * {@inheritdoc} - * @throws \Exception - */ - public function isDisplayed() - { - if ($this->getNumberOfGhostIndices() && $this->getNumberOfGhostIndices() > 1) { - return true; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getIdentity() - { - return hash('sha256', 'ELASTICSUITE_GHOST_INDICES_WARNING'); - } - - /** - * {@inheritdoc} - */ - public function getSeverity() - { - return self::SEVERITY_MAJOR; - } - - /** - * {@inheritdoc} - * @throws \Exception - */ - public function getText() - { - $messageDetails = ''; - - // @codingStandardsIgnoreStart - $messageDetails .= __( - 'You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.', - $this->getNumberOfGhostIndices() - ) . '
'; - $messageDetails .= __( - 'Click here to go to the Elasticsuite Indices page to take appropriate actions.', - $this->getElasticsuiteIndicesUrl() - ); - // @codingStandardsIgnoreEnd - - return $messageDetails; - } - - /** - * Get number of the Ghost Elasticsuite Indices - * - * @return mixed - * @throws \Exception - */ - private function getNumberOfGhostIndices() - { - if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) { - $elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices(); - $ghostIndices = []; - - foreach ($elasticsuiteIndices as $indexName => $indexAlias) { - $indexData = $this->indexStatsProvider->indexStats($indexName, $indexAlias); - - if (array_key_exists('index_status', $indexData) - && $indexData['index_status'] === self::GHOST_STATUS) { - $ghostIndices[] = [ - 'index_name' => $indexData['index_name'], - 'index_status' => $indexData['index_status'], - ]; - } - } - - if (!empty($ghostIndices)) { - return count($ghostIndices); - } - } - - return false; - } - - /** - * Get URL to the admin Elasticsuite Indices Status page - * - * @return string - */ - private function getElasticsuiteIndicesUrl() - { - return $this->urlBuilder->getUrl(self::ROUTE_ELASTICSUITE_INDICES); - } -} diff --git a/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterShardsMisconfig.php b/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterShardsMisconfig.php deleted file mode 100644 index 438dc6191..000000000 --- a/src/module-elasticsuite-indices/Model/System/Message/WarningAboutClusterShardsMisconfig.php +++ /dev/null @@ -1,184 +0,0 @@ - - * @copyright 2022 Smile - * @license Open Software License ("OSL") v. 3.0 - */ - -namespace Smile\ElasticsuiteIndices\Model\System\Message; - -use Magento\Framework\Notification\MessageInterface; -use Magento\Framework\UrlInterface; -use Smile\ElasticsuiteCore\Helper\IndexSettings as IndexSettingsHelper; -use Smile\ElasticsuiteIndices\Model\IndexStatsProvider; - -/** - * ElasticSuite Warning about Cluster mis-configuration for shards - * - * @category Smile - * @package Smile\ElasticsuiteIndices - * @author Vadym Honcharuk - * - * @SuppressWarnings(PHPMD.LongVariable) - */ -class WarningAboutClusterShardsMisconfig implements MessageInterface -{ - /** - * Route to Stores -> Configuration section - */ - private const ROUTE_SYSTEM_CONFIG = 'adminhtml/system_config/edit'; - - /** - * Anchor for Stores -> Configuration -> ELASTICSUITE -> Base Settings -> Indices Settings - */ - private const ANCHOR_ES_INDICES_SETTINGS_PATH = 'smile_elasticsuite_core_base_settings_indices_settings-link'; - - /** - * URL for Elasticsuite Indices Settings wiki page - */ - private const ES_INDICES_SETTINGS_WIKI_PAGE = 'https://github.com/Smile-SA/elasticsuite/wiki/ModuleInstall#indices-settings'; - - public const UNDEFINED_SIZE = 'N/A'; - - /** - * @var IndexSettingsHelper - */ - protected $helper; - - /** - * @var IndexStatsProvider - */ - protected $indexStatsProvider; - - /** - * @var UrlInterface - */ - private $urlBuilder; - - /** - * @param IndexSettingsHelper $indexSettingHelper Index settings helper - * @param IndexStatsProvider $indexStatsProvider Index stats provider - * @param UrlInterface $urlBuilder Url builder - */ - public function __construct( - IndexSettingsHelper $indexSettingHelper, - IndexStatsProvider $indexStatsProvider, - UrlInterface $urlBuilder - ) { - $this->helper = $indexSettingHelper; - $this->indexStatsProvider = $indexStatsProvider; - $this->urlBuilder = $urlBuilder; - } - - /** - * {@inheritdoc} - */ - public function isDisplayed() - { - $numberOfShards = $this->helper->getNumberOfShards(); - - if ($numberOfShards > 1) { - if ($this->getElasticsuiteIndexMaxSize()) { - $indexMaxSize = $this->getElasticsuiteIndexMaxSize()['size_in_bytes']; - - /* 10 Gb => 10737418240 bytes (in binary) */ - if ($indexMaxSize < '10737418240') { - return true; - } - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getIdentity() - { - return hash('sha256', 'ELASTICSUITE_SHARDS_WARNING'); - } - - /** - * {@inheritdoc} - */ - public function getSeverity() - { - return self::SEVERITY_MAJOR; - } - - /** - * {@inheritdoc} - */ - public function getText() - { - $messageDetails = ''; - - // @codingStandardsIgnoreStart - $messageDetails .= __('The number of shards configured for Elasticsuite is incorrect.') . ' '; - $messageDetails .= __( - 'You do not need to use %1 shards since your biggest Elasticsuite index is only %2.', - $this->helper->getNumberOfShards(), - $this->getElasticsuiteIndexMaxSize()['human_size'] - ) . '
'; - $messageDetails .= __( - 'Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page.', - $this->getElasticsuiteConfigUrl(), - self::ES_INDICES_SETTINGS_WIKI_PAGE - ); - // @codingStandardsIgnoreEnd - - return $messageDetails; - } - - /** - * Get size of the biggest Elasticsuite Indices - * - * @return mixed - * @throws \Exception - */ - private function getElasticsuiteIndexMaxSize() - { - if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) { - $elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices(); - $indexSizes = []; - - foreach ($elasticsuiteIndices as $indexName => $indexAlias) { - $indexData = $this->indexStatsProvider->indexStats($indexName, $indexAlias); - - if (array_key_exists('size', $indexData) && array_key_exists('size_in_bytes', $indexData) - && $indexData['size_in_bytes'] !== self::UNDEFINED_SIZE) { - $indexSizes[] = ['human_size' => $indexData['size'], 'size_in_bytes' => $indexData['size_in_bytes']]; - } - } - - if (!empty($indexSizes)) { - $indexSizesInBytes = array_column($indexSizes, "size_in_bytes"); - array_multisort($indexSizesInBytes, SORT_DESC, $indexSizes); - - return current($indexSizes); - } - } - - return false; - } - - /** - * Get URL to the admin Elasticsuite Configuration page - * - * @return string - */ - private function getElasticsuiteConfigUrl() - { - return $this->urlBuilder->getUrl( - self::ROUTE_SYSTEM_CONFIG, - ['section' => 'smile_elasticsuite_core_base_settings', '_fragment' => self::ANCHOR_ES_INDICES_SETTINGS_PATH] - ); - } -} diff --git a/src/module-elasticsuite-indices/etc/adminhtml/di.xml b/src/module-elasticsuite-indices/etc/adminhtml/di.xml deleted file mode 100644 index 50ff740a8..000000000 --- a/src/module-elasticsuite-indices/etc/adminhtml/di.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - Smile\ElasticsuiteIndices\Model\System\Message\WarningAboutClusterShardsMisconfig - Smile\ElasticsuiteIndices\Model\System\Message\WarningAboutClusterGhostIndices - - - - - From 59f5464133ecb5ae9e807d80245eda2b52a6271b Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Mon, 13 Jan 2025 20:34:45 +0100 Subject: [PATCH 2/5] [Healthchecks] Primary shards before replicas --- .../Model/Healthcheck/ReplicasConfigCheck.php | 2 +- .../Model/Healthcheck/ShardsConfigCheck.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php index 344d9aa9b..aa129c205 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php @@ -135,7 +135,7 @@ public function getStatus(): string */ public function getSortOrder(): int { - return 20; // Adjust as necessary. + return 30; // Adjust as necessary. } /** diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php index ecc4bf6a3..26595413a 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php @@ -142,7 +142,7 @@ public function getStatus(): string */ public function getSortOrder(): int { - return 30; // Adjust as necessary. + return 20; // Adjust as necessary. } /** From 4f24b85cd07c05fd041526cb12b5239d95c3d963 Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Mon, 13 Jan 2025 21:01:39 +0100 Subject: [PATCH 3/5] [Healthchecks] Rename primary shards test class --- .../{ShardsConfigCheck.php => PrimaryShardsConfigCheck.php} | 4 ++-- src/module-elasticsuite-core/etc/adminhtml/di.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/module-elasticsuite-core/Model/Healthcheck/{ShardsConfigCheck.php => PrimaryShardsConfigCheck.php} (98%) diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php similarity index 98% rename from src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php rename to src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php index 26595413a..5f7f3c6e1 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/ShardsConfigCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php @@ -25,7 +25,7 @@ * * Checks for shard misconfigurations in the Elasticsearch cluster. */ -class ShardsConfigCheck implements CheckInterface +class PrimaryShardsConfigCheck implements CheckInterface { /** * Route to Stores -> Configuration section. @@ -83,7 +83,7 @@ public function __construct( */ public function getIdentifier(): string { - return 'shards_config_check'; + return 'primary_shards_config_check'; } /** diff --git a/src/module-elasticsuite-core/etc/adminhtml/di.xml b/src/module-elasticsuite-core/etc/adminhtml/di.xml index 9c27a577a..78d73df43 100644 --- a/src/module-elasticsuite-core/etc/adminhtml/di.xml +++ b/src/module-elasticsuite-core/etc/adminhtml/di.xml @@ -33,7 +33,7 @@ Smile\ElasticsuiteCore\Model\Healthcheck\GhostIndicesCheck - Smile\ElasticsuiteCore\Model\Healthcheck\ShardsConfigCheck + Smile\ElasticsuiteCore\Model\Healthcheck\PrimaryShardsConfigCheck Smile\ElasticsuiteCore\Model\Healthcheck\ReplicasConfigCheck From 0d8286a447f4be7d9813b441f29c3eaf01caf9cc Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Mon, 13 Jan 2025 23:56:42 +0100 Subject: [PATCH 4/5] [Healthchecks] Reworked all i18n except system message --- .../Model/Healthcheck/GhostIndicesCheck.php | 21 ++++++++++------ .../Healthcheck/PrimaryShardsConfigCheck.php | 25 +++++++++++++------ .../Model/Healthcheck/ReplicasConfigCheck.php | 22 ++++++++++------ src/module-elasticsuite-core/i18n/de_DE.csv | 14 +++++++++-- src/module-elasticsuite-core/i18n/en_US.csv | 14 +++++++++-- src/module-elasticsuite-core/i18n/fr_FR.csv | 13 ++++++++-- src/module-elasticsuite-core/i18n/nl_NL.csv | 14 +++++++++-- .../i18n/de_DE.csv | 5 ---- .../i18n/en_US.csv | 5 ---- .../i18n/fr_FR.csv | 5 ---- .../i18n/nl_NL.csv | 5 ---- 11 files changed, 92 insertions(+), 51 deletions(-) diff --git a/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php index deea5db57..3f8268229 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/GhostIndicesCheck.php @@ -80,18 +80,25 @@ public function getDescription(): string if ($ghostCount > 0) { // Description when ghost indices are found. // @codingStandardsIgnoreStart - return __( - 'You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. ' - . 'You should consider removing them.
' - . 'Click here to go to the Elasticsuite Indices page to take appropriate actions.', - $ghostCount, - $this->getElasticsuiteIndicesUrl() + return implode( + '
', + [ + __( + 'You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. ' + . 'You should consider removing them.', + $ghostCount + ), + __( + 'Click here to go to the Elasticsuite Indices page to take appropriate actions.', + $this->getElasticsuiteIndicesUrl() + ) + ] ); // @codingStandardsIgnoreEnd } // Description when no ghost indices are found. - return __('There are no ghost indexes in your Elasticsearch cluster. No action is required at this time.'); + return __('There are no ghost indices in your Elasticsearch cluster. No action is required at this time.'); } /** diff --git a/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php index 5f7f3c6e1..c33cf3ad3 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/PrimaryShardsConfigCheck.php @@ -101,14 +101,23 @@ public function getDescription(): string if ($status === CheckInterface::WARNING_STATUS) { // Description when the shard's configuration is incorrect. // @codingStandardsIgnoreStart - return __( - 'The number of shards configured for Elasticsuite is incorrect. ' - . 'You don\'t need to use %1 shards since your biggest Elasticsuite index is only %2.
' - . 'Click here to go to the Elasticsuite Basic Settings page and change your Number of Shards per Index parameter according to our Wiki page.', - $numberOfShards, - $maxIndexSize['human_size'], - $this->getElasticsuiteConfigUrl(), - self::ES_INDICES_SETTINGS_WIKI_PAGE + return implode( + '
', + [ + __( + 'The number of shards configured for Elasticsuite is incorrect.' + ), + __( + 'You do not need to use %1 shards since your biggest Elasticsuite index is only %2.', + $numberOfShards, + $maxIndexSize['human_size'] + ), + __( + 'Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page.', + $this->getElasticsuiteConfigUrl(), + self::ES_INDICES_SETTINGS_WIKI_PAGE + ) + ] ); // @codingStandardsIgnoreEnd } diff --git a/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php index aa129c205..520dee820 100644 --- a/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php +++ b/src/module-elasticsuite-core/Model/Healthcheck/ReplicasConfigCheck.php @@ -95,14 +95,20 @@ public function getDescription(): string if ($status === CheckInterface::WARNING_STATUS) { // Description when the replicas configuration is incorrect. // @codingStandardsIgnoreStart - return __( - 'The number of replicas configured for Elasticsuite is incorrect. ' - . 'You can\'t use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.
' - . 'Click here to go to the Elasticsuite Basic Settings page and change your Number of Replicas per Index parameter according to our Wiki page.', - $this->helper->getNumberOfReplicas(), - $this->getNumberOfNodes(), - $this->getElasticsuiteConfigUrl(), - self::ES_INDICES_SETTINGS_WIKI_PAGE + return implode( + '
', + [ + __( + 'The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.', + $this->helper->getNumberOfReplicas(), + $this->getNumberOfNodes() + ), + __( + 'Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page.', + $this->getElasticsuiteConfigUrl(), + self::ES_INDICES_SETTINGS_WIKI_PAGE + ), + ] ); // @codingStandardsIgnoreEnd } diff --git a/src/module-elasticsuite-core/i18n/de_DE.csv b/src/module-elasticsuite-core/i18n/de_DE.csv index 68a6015c1..c8a49fe6e 100644 --- a/src/module-elasticsuite-core/i18n/de_DE.csv +++ b/src/module-elasticsuite-core/i18n/de_DE.csv @@ -74,8 +74,6 @@ "Search engine powered by %1","Suchmaschine unterstützt von %1" "Miscellaneous","Sonstiges" "The value should be different to zero.","Der Wert sollte sich von Null unterscheiden." -"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Die Anzahl der Repliken, die für Elasticsuite konfiguriert wurden, ist falsch. Sie können %1 Repliken nicht verwenden, da es nur %2 Knoten in Ihrem Elasticsearch Cluster gibt." -"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page.","Klicken Sie hier, um zur Elasticsuite Konfiguration Seite zu wechseln und Ihre Anzahl der Replikas pro Index Parameter entsprechend unserer Wiki-Seite zu ändern." "Span Match Configuration","Span Match Konfiguration" "Enable Boost on Span Match","Boost bei Span Match aktivieren" "Span Match Boost Value","Span Match Boost Wert" @@ -120,3 +118,15 @@ "If enabled, when indexing a reference like ""DC3000"", it will be as if ""DC3"" was indexed instead (leading to independant elements ""DC"", ""3"" and ""DC3"" in the search index). This will allow someone searching for ""dc3"" or ""dc 3"" to find the product with the exact ""DC3000"" sku.","Wenn aktiviert, wenn eine Referenz wie ""DC3000"" indiziert wird wird es sein, als ob ""DC3"" stattdessen indiziert wurde (was zu unabhängigen Elementen ""DC"", ""3"" und ""DC3"" im Suchindex). Dadurch kann jemand, der nach ""dc3"" oder ""dc 3"" sucht, das Produkt mit dem genauen ""DC3000"" sku finden." "Reduce series of contiguous zeroes in numeric parts","Reduziert die Serie der angrenzenden Nullen in numerischen Teilen" "If enabled, when indexing a reference like ""PL20004"", it will be as if ""PL204"" was indexed instead (leading to independant elements ""PL"", ""204"" and ""PL204"" in the search index). This will allow someone searching for ""pl204"", ""pl 204"", ""pl2004"" or ""pl 2004"" to find the product with the exact ""PL2004"" sku.","Wenn aktiviert, wenn eine Referenz wie ""PL20004"" indiziert wird wird es sein, als ob ""PL204"" stattdessen indiziert wurde (was zu unabhängigen Elementen ""PL"", ""204"" und ""PL204"" im Suchindex führt). Dadurch kann jemand, der nach ""pl204"", ""pl 204"", ""pl2004"" oder ""pl 2004"" sucht, das Produkt mit dem genauen ""PL2004"" sku finden." +"You have %1 health checks in Warning state. We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them.","Sie haben %1 Gesundheitsprüfungen im Status Warnung. Wir laden Sie ein, die Seite Elasticsuite Healthcheck zu besuchen, um weitere Details zu erhalten und zu erfahren, wie Sie diese beheben können." +"The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","Die Anzahl der Sherben ist für den Elasticsearch-Cluster ordnungsgemäß konfiguriert. Derzeit sind keine Maßnahmen erforderlich." +"The number of shards configured for Elasticsuite is incorrect.","Die Anzahl der Scherben für Elasticsuite konfigurierten ist falsch." +"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Sie müssen keine %1 Scherben verwenden, da Ihr größter Elasticsuite-Index nur %2 ist." +"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page.","Klicken Sie hier, um zur Elasticsuite Konfiguration Seite zu wechseln und Ihre Anzahl der Scherben pro Index Parameter entsprechend unserer Wiki-Seite zu ändern." +"The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.","Die Anzahl der Replikate ist für den Elasticsearch-Cluster ordnungsgemäß konfiguriert. Derzeit sind keine Maßnahmen erforderlich." +"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Die Anzahl der Repliken, die für Elasticsuite konfiguriert wurden, ist falsch. Sie können %1 Repliken nicht verwenden, da es nur %2 Knoten in Ihrem Elasticsearch Cluster gibt." +"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page.","Klicken Sie hier, um zur Elasticsuite Konfiguration Seite zu wechseln und Ihre Anzahl der Replikas pro Index Parameter entsprechend unserer Wiki-Seite zu ändern." +"There are no ghost indices in your Elasticsearch cluster. No action is required at this time.","In Ihrem Elasticsearch-Cluster gibt es keine Geisterindizes. Derzeit sind keine Maßnahmen erforderlich." +"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Sie haben %1 Geister-Indizes. Geister-Indizes haben einen Fußabdruck auf Ihrer Elasticsearch Cluster-Gesundheit. Sie sollten in Erwägung ziehen, sie zu entfernen." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klicken Sie hier, um zu den Elasticsuite Indizes Seite zu gelangen, um entsprechende Aktionen durchzuführen." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klicken Sie hier, um zu den Elasticsuite Indizes Seite zu gelangen, um entsprechende Aktionen durchzuführen." diff --git a/src/module-elasticsuite-core/i18n/en_US.csv b/src/module-elasticsuite-core/i18n/en_US.csv index 3b249391f..5774b6958 100644 --- a/src/module-elasticsuite-core/i18n/en_US.csv +++ b/src/module-elasticsuite-core/i18n/en_US.csv @@ -74,8 +74,6 @@ Autocomplete,Autocomplete "Search engine powered by %1","Search engine powered by %1" "Miscellaneous","Miscellaneous" "The value should be different to zero.","The value should be different to zero." -"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster." -"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page.","Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page." "Span Match Configuration","Span Match Configuration" "Enable Boost on Span Match","Enable Boost on Span Match" "Span Match Boost Value","Span Match Boost Value" @@ -130,3 +128,15 @@ Autocomplete,Autocomplete "Please select a stemmer for the store","Please select a stemmer for the store" "Time for an index to be considered Ghost (in seconds)","Time for an index to be considered Ghost (in seconds)" "Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour).","Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour)." +"You have %1 health checks in a warning state. Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them.","You have %1 health checks in a warning state. Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them." +"The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time." +"The number of shards configured for Elasticsuite is incorrect.","The number of shards configured for Elasticsuite is incorrect." +"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","You do not need to use %1 shards since your biggest Elasticsuite index is only %2." +"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page.","Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page." +"The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.","The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time." +"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster." +"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page.","Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page." +"There are no ghost indices in your Elasticsearch cluster. No action is required at this time.","There are no ghost indices in your Elasticsearch cluster. No action is required at this time." +"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Click here to go to the Elasticsuite Indices page to take appropriate actions." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Click here to go to the Elasticsuite Indices page to take appropriate actions." diff --git a/src/module-elasticsuite-core/i18n/fr_FR.csv b/src/module-elasticsuite-core/i18n/fr_FR.csv index d5dde3dae..78f07626f 100644 --- a/src/module-elasticsuite-core/i18n/fr_FR.csv +++ b/src/module-elasticsuite-core/i18n/fr_FR.csv @@ -74,8 +74,6 @@ General,Général "Search engine powered by %1","Recherche propulsée par %1" "Miscellaneous","Divers" "The value should be different to zero.","La valeur doit être différente de zéro." -"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Le nombre de replicas configuré pour Elasticsuite est incorrect. Vous ne pouvez pas utiliser %1 replicas car il n'y a que %2 nodes dans votre cluster Elasticsearch." -"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page.","Cliquez ici pour accéder à la configuration Elasticsuite et changer le paramètre Nombre de replicas par Index conformément à notre page de wiki." "Span Match Configuration","Recherche sur le début des champs" "Enable Boost on Span Match","Activer le boost sur le début des champs" "Span Match Boost Value","Valeur du boost" @@ -130,3 +128,14 @@ General,Général "Please select a stemmer for the store","Veuillez sélectionner un stemmer pour le magasin" "Time for an index to be considered Ghost (in seconds)","Temps avant qu'un index soit considéré Fantôme (en secondes)" "Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour).","Les index Elasticsuite résultant de l'échec d'une ré-indexation complète sont considérés comme fantômes après que cette période de temps (en secondes) s'est écoulée depuis leur création. Vous pouvez réduire cette période de temps pour accélérer la suppression des index fantômes, mais prenez soin d'ajouter une période de sécurité au temps de réindexation maximum de l'index le plus complexe de votre plateforme (généralement un index catalog_product/de recherche produits). Valeur par défaut: 172 800 secondes (2 jours), valeur minimum: 3600 (1 heure)." +"The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","Le nombre de shards est correctement configuré pour le cluster Elasticsearch. Aucune action n’est requise pour le moment." +"The number of shards configured for Elasticsuite is incorrect.","Le nombre de shards configuré pour Elasticsuite est incorrect." +"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Vous n'avez pas besoin d'utiliser %1 shards car votre index Elasticsuite le plus volumineux pèse %2." +"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page.","Cliquez ici pour accéder à la page de Configuration Elasticsuite et changer votre Nombre de shards par Index conformément à notre page wiki." +"The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.","Le nombre de réplicas est correctement configuré pour le cluster Elasticsearch. Aucune action n’est requise pour le moment." +"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Le nombre de replicas configuré pour Elasticsuite est incorrect. Vous ne pouvez pas utiliser %1 replicas car il n'y a que %2 nodes dans votre cluster Elasticsearch." +"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page.","Cliquez ici pour accéder à la configuration Elasticsuite et changer le paramètre Nombre de replicas par Index conformément à notre page wiki." +"There are no ghost indices in your Elasticsearch cluster. No action is required at this time.","Il n'y a aucun index fantôme dans votre cluster Elasticsearch. Aucune action n’est requise pour le moment." +"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Vous avez %1 index fantômes. Les indexs fantômes consomment inutilement des ressources de votre cluster Elasticsearch. Vous devriez envisager de les supprimer." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Cliquez ici pour accéder à la liste des indexs Elasticsuite et prendre les actions appropriées." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Cliquez ici pour accéder à la liste des indexs Elasticsuite et prendre les actions appropriées." diff --git a/src/module-elasticsuite-core/i18n/nl_NL.csv b/src/module-elasticsuite-core/i18n/nl_NL.csv index 748870293..220a5af5b 100644 --- a/src/module-elasticsuite-core/i18n/nl_NL.csv +++ b/src/module-elasticsuite-core/i18n/nl_NL.csv @@ -74,8 +74,6 @@ "Search engine powered by %1","Zoekmachine aangedreven door %1" "Miscellaneous","Diversen" "The value should be different to zero.","De waarde moet verschillen van nul." -"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Het aantal replica's geconfigureerd voor Elasticsuite is onjuist. Je kunt %1 replicas niet gebruiken, omdat er alleen %2 nodes is in je Elasticsearch cluster." -"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our wiki page.","Klik hier om naar de Elasticsuite Config pagina te gaan en uw Aantal Replicas per Index parameter te wijzigen volgens onze wikipagina." "Span Match Configuration","Span Match Configuratie" "Enable Boost on Span Match","Boost op Span Wedstrijd inschakelen" "Span Match Boost Value","Span overeenkomst Boost Waarde" @@ -120,3 +118,15 @@ "If enabled, when indexing a reference like ""DC3000"", it will be as if ""DC3"" was indexed instead (leading to independant elements ""DC"", ""3"" and ""DC3"" in the search index). This will allow someone searching for ""dc3"" or ""dc 3"" to find the product with the exact ""DC3000"" sku.","Indien ingeschakeld, bij het indexeren van een verwijzing zoals ""DC3000"", het zal zijn alsof in plaats daarvan ""DC3"" is geïndexeerd (wat leidt tot onafhankelijke elementen ""DC"", ""3"" en ""DC3"" in de zoekindex). Hierdoor kan iemand het product zoeken naar ""dc3"" of ""dc 3"" vinden met de exacte ""DC3000"" sku." "Reduce series of contiguous zeroes in numeric parts","Verminder serie van aangrenzende nullen in numerieke onderdelen" "If enabled, when indexing a reference like ""PL20004"", it will be as if ""PL204"" was indexed instead (leading to independant elements ""PL"", ""204"" and ""PL204"" in the search index). This will allow someone searching for ""pl204"", ""pl 204"", ""pl2004"" or ""pl 2004"" to find the product with the exact ""PL2004"" sku.","Indien ingeschakeld, bij het indexeren van een verwijzing zoals ""PL20004"", het zal zijn alsof in plaats daarvan ""PL204"" is geïndexeerd (wat leidt tot onafhankelijke elementen ""PL"", ""204"" en ""PL204"" in de zoekindex). Hierdoor kan iemand het product zoeken naar ""pl204"", ""pl 204"", ""pl2004"" of ""pl 2004"" om het te vinden met de exacte ""PL2004"" sku." +"You have %1 health checks in Warning state. We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them.","U heeft %1 gezondheidscontroles in de status Waarschuwing. We nodigen u uit om naar de Elasticsuite Healthcheck pagina te gaan voor meer details en om te zien hoe u deze kunt oplossen." +"The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","Het aantal Scherven is correct geconfigureerd voor het Elasticsearch-cluster. Er is op dit moment geen actie vereist." +"The number of shards configured for Elasticsuite is incorrect.","Het aantal scherven geconfigureerd voor Elasticsuite is onjuist." +"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Je hoeft geen %1 scherven te gebruiken omdat je grootste Elasticsuite index slechts %2 is." +"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our Wiki page.","Klik hier om naar de Elasticsuite Config pagina te gaan en uw Aantal Scherven per Index parameter te wijzigen volgens onze wikipagina." +"The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.","Het aantal replica's is correct geconfigureerd voor het Elasticsearch-cluster. Er is op dit moment geen actie vereist." +"The number of replicas configured for Elasticsuite is incorrect. You cannot use %1 replicas since there is only %2 nodes in your Elasticsearch cluster.","Het aantal replica's geconfigureerd voor Elasticsuite is onjuist. Je kunt %1 replicas niet gebruiken, omdat er alleen %2 nodes is in je Elasticsearch cluster." +"Click here to go to the Elasticsuite Config page and change your Number of Replicas per Index parameter according to our Wiki page.","Klik hier om naar de Elasticsuite Config pagina te gaan en uw Aantal Replicas per Index parameter te wijzigen volgens onze wikipagina." +"There are no ghost indices in your Elasticsearch cluster. No action is required at this time.","Er zijn geen spookindexen in uw Elasticsearch-cluster. Er is op dit moment geen actie vereist." +"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Je hebt %1 spookindexen. Spook indices hebben een voetafdruk op je Elasticsearch cluster gezondheid. Je zou moeten overwegen om ze te verwijderen." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klik hier om naar de Elasticsuite Indices pagina te gaan om de juiste acties te ondernemen." +"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klik hier om naar de Elasticsuite Indices pagina te gaan om de juiste acties te ondernemen." diff --git a/src/module-elasticsuite-indices/i18n/de_DE.csv b/src/module-elasticsuite-indices/i18n/de_DE.csv index 66f42e661..0fb852a8d 100644 --- a/src/module-elasticsuite-indices/i18n/de_DE.csv +++ b/src/module-elasticsuite-indices/i18n/de_DE.csv @@ -22,11 +22,6 @@ "Add mapping of index","Zuordnung des Index hinzufügen" "Indices Mapping","Indizes Mapping" "Mapping","Zuordnung" -"The number of shards configured for Elasticsuite is incorrect.","Die Anzahl der für Elasticsuite konfigurierten Scherben ist falsch." -"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Sie müssen keine %1 Scherben verwenden, da Ihr größter Elasticsuite-Index nur %2 ist." -"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page.","Klicken Sie hier, um zur Elasticsuite Konfiguration Seite zu wechseln und Ihre Anzahl der Scherben pro Index Parameter entsprechend unserer Wiki-Seite zu ändern." -"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Sie haben %1 Geister-Indizes. Geister-Indizes haben einen Fußabdruck auf Ihrer Elasticsearch Cluster-Gesundheit. Sie sollten in Erwägung ziehen, sie zu entfernen." -"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klicken Sie hier, um zu den Elasticsuite Indizes Seite zu gelangen, um entsprechende Aktionen durchzuführen." "Analysis","Analyse" "Analyze by Analyzer","Analysieren durch Analyzer" "Index name:","Indexname:" diff --git a/src/module-elasticsuite-indices/i18n/en_US.csv b/src/module-elasticsuite-indices/i18n/en_US.csv index 57eeecc78..779e1695b 100644 --- a/src/module-elasticsuite-indices/i18n/en_US.csv +++ b/src/module-elasticsuite-indices/i18n/en_US.csv @@ -22,11 +22,6 @@ "Add mapping of index", "Add mapping of index" "Indices Mapping", "Indices Mapping" "Mapping", "Mapping" -"The number of shards configured for Elasticsuite is incorrect.","The number of shards configured for Elasticsuite is incorrect." -"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","You do not need to use %1 shards since your biggest Elasticsuite index is only %2." -"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page.","Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page." -"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them." -"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Click here to go to the Elasticsuite Indices page to take appropriate actions." "Analysis","Analysis" "Analyze by Analyzer","Analyze by Analyzer" "Index name:","Index name:" diff --git a/src/module-elasticsuite-indices/i18n/fr_FR.csv b/src/module-elasticsuite-indices/i18n/fr_FR.csv index 5e62019b6..73762adc9 100644 --- a/src/module-elasticsuite-indices/i18n/fr_FR.csv +++ b/src/module-elasticsuite-indices/i18n/fr_FR.csv @@ -22,11 +22,6 @@ "Add mapping of index", "Ajouter un mappage d'index" "Indices Mapping", "Mapping des index" "Mapping", "Mapping" -"The number of shards configured for Elasticsuite is incorrect.","Le nombre de shards configuré pour Elasticsuite est incorrect." -"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Vous n'avez pas besoin d'utiliser %1 shards car votre index Elasticsuite le plus volumineux pèse %2." -"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page.","Cliquez ici pour accéder à la page de Configuration Elasticsuite et changer votre Nombre de shards par Index conformément à notre page du wiki." -"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Vous avez %1 index fantômes. Les indexs fantômes consomment inutilement des ressources de votre cluster Elasticsearch. Vous devriez envisager de les supprimer." -"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Cliquez ici pour accéder à la liste des indexs Elasticsuite et prendre les actions appropriées." "Analysis","Analyse textuelle" "Analyze by Analyzer","Analyser par Analyzer" "Index name:","Nom de l'index:" diff --git a/src/module-elasticsuite-indices/i18n/nl_NL.csv b/src/module-elasticsuite-indices/i18n/nl_NL.csv index 9e31b7dad..9f1c9d4b7 100644 --- a/src/module-elasticsuite-indices/i18n/nl_NL.csv +++ b/src/module-elasticsuite-indices/i18n/nl_NL.csv @@ -22,11 +22,6 @@ "Add mapping of index","Toewijzing van index toevoegen" "Indices Mapping","Indices mapping" "Mapping","Toewijzing" -"The number of shards configured for Elasticsuite is incorrect.","Het aantal scherven geconfigureerd voor Elasticsuite is onjuist." -"You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Je hoeft geen %1 shards te gebruiken omdat je grootste Elasticsuite index slechts %2 is." -"Click here to go to the Elasticsuite Config page and change your Number of Shards per Index parameter according to our wiki page.","Klik hier om naar de Elasticsuite Config pagina te gaan en uw Aantal Scherven per Index parameter te wijzigen volgens onze wikipagina." -"You have %1 ghost indices. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Je hebt %1 spookindexen. Spook indices hebben een voetafdruk op je Elasticsearch cluster gezondheid. Je zou moeten overwegen om ze te verwijderen." -"Click here to go to the Elasticsuite Indices page to take appropriate actions.","Klik hier om naar de Elasticsuite Indices pagina te gaan om de juiste acties te ondernemen." "Analysis","Analyse" "Analyze by Analyzer","Analyseer door Analyzer" "Index name:","Index naam:" From 0700a1060e217d47b49a196dbc35a3ad79193ead Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Tue, 14 Jan 2025 15:46:51 +0100 Subject: [PATCH 5/5] [Healthchecks] Reworked system message i18n --- .../Model/System/Message/GenericHealthcheckWarning.php | 4 ++-- src/module-elasticsuite-core/i18n/en_US.csv | 2 +- src/module-elasticsuite-core/i18n/fr_FR.csv | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php b/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php index 3372ffa0c..c192dbc42 100644 --- a/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php +++ b/src/module-elasticsuite-core/Model/System/Message/GenericHealthcheckWarning.php @@ -86,8 +86,8 @@ public function getText() // @codingStandardsIgnoreStart return __( - 'You have %1 health checks in a warning state. ' - . 'Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them.', + 'You have %1 health checks in Warning state. ' + . 'We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them.', $issuesCount, $this->getElasticsuiteHealthcheckUrl() ); diff --git a/src/module-elasticsuite-core/i18n/en_US.csv b/src/module-elasticsuite-core/i18n/en_US.csv index 5774b6958..cb1c0cc10 100644 --- a/src/module-elasticsuite-core/i18n/en_US.csv +++ b/src/module-elasticsuite-core/i18n/en_US.csv @@ -128,7 +128,7 @@ Autocomplete,Autocomplete "Please select a stemmer for the store","Please select a stemmer for the store" "Time for an index to be considered Ghost (in seconds)","Time for an index to be considered Ghost (in seconds)" "Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour).","Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour)." -"You have %1 health checks in a warning state. Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them.","You have %1 health checks in a warning state. Please head to the Elasticsuite Healthcheck page to get more details and see how to fix them." +"You have %1 health checks in Warning state. We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them.","You have %1 health checks in Warning state. We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them." "The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time." "The number of shards configured for Elasticsuite is incorrect.","The number of shards configured for Elasticsuite is incorrect." "You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","You do not need to use %1 shards since your biggest Elasticsuite index is only %2." diff --git a/src/module-elasticsuite-core/i18n/fr_FR.csv b/src/module-elasticsuite-core/i18n/fr_FR.csv index 78f07626f..f2177dc7e 100644 --- a/src/module-elasticsuite-core/i18n/fr_FR.csv +++ b/src/module-elasticsuite-core/i18n/fr_FR.csv @@ -128,6 +128,7 @@ General,Général "Please select a stemmer for the store","Veuillez sélectionner un stemmer pour le magasin" "Time for an index to be considered Ghost (in seconds)","Temps avant qu'un index soit considéré Fantôme (en secondes)" "Elasticsuite derelict indices resulting from a failed full reindex are considered ghost after this amount of time (in seconds) has elapsed since their creation. You can reduce this amount of time to speed up ghost indices cleanup, but take care to add a safety on top of the maximum reindexing duration of the more complex index of your platform (usually a catalog_product/product search index). Defaults to 172,800 seconds (2 days), minimum value: 3600 (1 hour).","Les index Elasticsuite résultant de l'échec d'une ré-indexation complète sont considérés comme fantômes après que cette période de temps (en secondes) s'est écoulée depuis leur création. Vous pouvez réduire cette période de temps pour accélérer la suppression des index fantômes, mais prenez soin d'ajouter une période de sécurité au temps de réindexation maximum de l'index le plus complexe de votre plateforme (généralement un index catalog_product/de recherche produits). Valeur par défaut: 172 800 secondes (2 jours), valeur minimum: 3600 (1 heure)." +"You have %1 health checks in Warning state. We invite you to head to the Elasticsuite Healthcheck page to get more details and to see how to fix them.","Vous avez %1 points de contrôle à l'état d'Avertissement. Nous vous invitons à vous rendre sur la page Elasticsuite Healthcheck pour obtenir plus de détails et voir comment les corriger." "The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","Le nombre de shards est correctement configuré pour le cluster Elasticsearch. Aucune action n’est requise pour le moment." "The number of shards configured for Elasticsuite is incorrect.","Le nombre de shards configuré pour Elasticsuite est incorrect." "You do not need to use %1 shards since your biggest Elasticsuite index is only %2.","Vous n'avez pas besoin d'utiliser %1 shards car votre index Elasticsuite le plus volumineux pèse %2."