├── .github
├── FUNDING.yml
├── workflows
│ └── php.yml
└── issue_template.md
├── i18n
└── en_US.csv
├── registration.php
├── Api
├── SubscriberInterface.php
├── ReindexInterface.php
└── StrategyInterface.php
├── etc
├── communication.xml
├── queue_publisher.xml
├── config.xml
├── queue_consumer.xml
├── adminhtml
│ ├── routes.xml
│ └── system.xml
├── module.xml
├── queue_topology.xml
├── acl.xml
└── di.xml
├── Controller
└── Adminhtml
│ ├── Indexer.php
│ └── Indexer
│ └── ReindexOnTheFly.php
├── Model
├── Strategy.php
├── Subscriber.php
├── Strategies
│ ├── Standard.php
│ └── Deferred.php
├── Reindex.php
└── StrategyResolver.php
├── view
└── adminhtml
│ └── layout
│ └── indexer_indexer_list_grid.xml
├── Block
└── Adminhtml
│ └── System
│ └── Config
│ ├── Source
│ └── Strategy.php
│ └── Form
│ └── Field
│ └── Link.php
├── composer.json
└── README.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | #github: [srenon]
4 | custom: ['https://www.magepal.com/reindex.html?utm_source=reindex&utm_medium=github%20sponsor']
5 |
--------------------------------------------------------------------------------
/i18n/en_US.csv:
--------------------------------------------------------------------------------
1 | "Module Version","Module Version"
2 | "Composer Version","Composer Version"
3 | "Configuration","Configuration"
4 | "Please select indexers.","Please select indexers."
5 | "Reindex %1 indexer(s).","Reindex %1 indexer(s)."
6 | "We couldn't reindex because of an error.","We couldn't reindex because of an error."
7 | "Reindex","Reindex"
--------------------------------------------------------------------------------
/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Api/ReindexInterface.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Api/StrategyInterface.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | standard
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/etc/queue_consumer.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/etc/adminhtml/routes.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.github/workflows/php.yml:
--------------------------------------------------------------------------------
1 | name: PHPCS
2 | on: [push]
3 | jobs:
4 | build:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - uses: actions/checkout@master
8 | - name: PHPCS
9 | run: docker run --rm -v $PWD:/code:ro domw/phpcs phpcs --colors --standard=Magento2 --report=full,summary,gitblame --extensions=php,phtml ./
10 | - name: compatibility
11 | run: docker run --rm -v $PWD:/code:ro domw/phpcompatibility phpcs --standard=PHPCompatibility --runtime-set testVersion 7.1-7.4 --colors --warning-severity=0 --report=full,summary --extensions=php,phtml ./
12 |
--------------------------------------------------------------------------------
/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/etc/queue_topology.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Indexer.php:
--------------------------------------------------------------------------------
1 | _request->getActionName()) {
19 | case 'reindexOnTheFly':
20 | return $this->_authorization->isAllowed('Magento_Indexer::changeMode');
21 | }
22 |
23 | return false;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/etc/acl.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Model/Strategy.php:
--------------------------------------------------------------------------------
1 | resolver = $resolver;
24 | }
25 |
26 | /**
27 | * @param array|null $indexIds
28 | * @throws \Magento\Framework\Exception\InputException
29 | */
30 | public function process(?array $indexIds = null) : void
31 | {
32 | $this->resolver->resolveActive()->process($indexIds);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Model/Subscriber.php:
--------------------------------------------------------------------------------
1 | reindexService = $reindexService;
25 | }
26 |
27 | /**
28 | * @param array $indices
29 | */
30 | public function processMessage(?array $indices) : void
31 | {
32 | $this->reindexService->reindex($indices);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/view/adminhtml/layout/indexer_indexer_list_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 | -
15 |
- Reindex
16 | - */indexer/reindexOnTheFly
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Block/Adminhtml/System/Config/Source/Strategy.php:
--------------------------------------------------------------------------------
1 | strategies = $strategies;
24 | }
25 |
26 | /**
27 | * @return array
28 | */
29 | public function toOptionArray() : array
30 | {
31 | $options = [];
32 | foreach ($this->strategies as $key => $label) {
33 | $options[] = ['value' => $key, 'label' => __($label)];
34 | }
35 | return $options;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Model/Strategies/Standard.php:
--------------------------------------------------------------------------------
1 | reindexService = $reindexService;
26 | }
27 |
28 | /**
29 | * Handle the reindex within the current process
30 | *
31 | * @param array|null $indexIds
32 | */
33 | public function process(?array $indexIds = null) : void
34 | {
35 | $this->reindexService->reindex($indexIds);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Model/Reindex.php:
--------------------------------------------------------------------------------
1 | indexerFactory = $indexerFactory;
25 | }
26 |
27 | /**
28 | * Implements synchronous reindexing
29 | *
30 | * @param array|null $indexIds
31 | */
32 | public function reindex(?array $indexIds = null) : void
33 | {
34 | foreach ($indexIds as $index) {
35 | $indexer = $this->indexerFactory->create();
36 | $indexer->load($index)->reindexAll();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Model/Strategies/Deferred.php:
--------------------------------------------------------------------------------
1 | publisher = $publisher;
28 | }
29 |
30 | /**
31 | * Push the indexIDs to our message queue to processed by another process
32 | *
33 | * @param array|null $indexIds
34 | */
35 | public function process(?array $indexIds = null) : void
36 | {
37 | $this->publisher->publish(self::TOPIC_NAME, $indexIds);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #### Magento version #:
7 |
8 | #### Edition (EE, CE, OS, etc):
9 |
10 | #### Expected behavior:
11 |
12 | #### Actual behavior:
13 |
14 | #### Steps to reproduce:
15 |
16 | #### Preconditions
17 |
18 |
19 |
20 |
21 |
37 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "magepal/magento2-reindex",
3 | "description": "Reindex your Magento2 store quickly and easily from backend/admin, instead of command line.",
4 | "keywords": [
5 | "magento 2",
6 | "magento2",
7 | "reindex",
8 | "backend reindex",
9 | "admin reindex"
10 | ],
11 | "require": {
12 | "php": "~8.3.0|~8.4.0",
13 | "magento/module-backend": "102.0.*",
14 | "magento/framework": "103.0.*",
15 | "magepal/magento2-core":">1.1.8"
16 | },
17 | "type": "magento2-module",
18 | "version": "1.2.0",
19 | "license": [
20 | "proprietary"
21 | ],
22 | "homepage": "https://www.magepal.com/",
23 | "support": {
24 | "email": "support@magepal.com",
25 | "issues": "https://github.com/magepal/magento2-reindex/issues/"
26 | },
27 | "authors": [
28 | {
29 | "name": "Renon Stewart",
30 | "email": "renon@magepal.com",
31 | "homepage": "https://www.magepal.com/",
32 | "role": "Leader"
33 | }
34 | ],
35 | "autoload": {
36 | "files": [
37 | "registration.php"
38 | ],
39 | "psr-4": {
40 | "MagePal\\Reindex\\": ""
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Block/Adminhtml/System/Config/Form/Field/Link.php:
--------------------------------------------------------------------------------
1 | unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
28 | return parent::render($element);
29 | }
30 |
31 | /**
32 | * Return element html
33 | *
34 | * @param AbstractElement $element
35 | * @return string
36 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
37 | */
38 | protected function _getElementHtml(AbstractElement $element)
39 | {
40 | return sprintf(
41 | '%s',
42 | $this->_urlBuilder->getUrl('indexer/indexer/list'),
43 | __('System > Tools > Index Management')
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | - Standard
19 | - Deferred
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | - MagePal\Reindex\Model\Strategies\Standard
28 | - MagePal\Reindex\Model\Strategies\Deferred
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Model/StrategyResolver.php:
--------------------------------------------------------------------------------
1 | scopeConfig = $scopeConfigInterface;
34 | $this->strategies = $strategies;
35 | }
36 |
37 | /**
38 | * Resolve a strategy key to its correct class
39 | *
40 | * @param string $strategy
41 | * @return StrategyInterface
42 | * @throws InputException
43 | */
44 | public function resolve(string $strategy) : StrategyInterface
45 | {
46 | if (!array_key_exists($strategy, $this->strategies)) {
47 | throw new InputException(__("Invalid Strategy Key: $strategy"));
48 | }
49 |
50 | return $this->strategies[$strategy];
51 | }
52 |
53 | /**
54 | * Handle resolving the current active strategy from system config to a class
55 | *
56 | * @return StrategyInterface
57 | * @throws InputException
58 | */
59 | public function resolveActive() : StrategyInterface
60 | {
61 | return $this->resolve($this->getActiveStrategy());
62 | }
63 |
64 | /**
65 | * Get the active indexation strategy key from the backend
66 | *
67 | * @return string
68 | */
69 | public function getActiveStrategy() : string
70 | {
71 | return $this->scopeConfig->getValue(self::XML_STRATEGY_PATH);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Indexer/ReindexOnTheFly.php:
--------------------------------------------------------------------------------
1 | indexerFactory = $indexerFactory;
39 | $this->reindexStrategy = $reindexStrategy;
40 | parent::__construct($context);
41 | }
42 |
43 | /**
44 | * @return void
45 | */
46 | public function execute()
47 | {
48 | $indexerIds = $this->getRequest()->getParam('indexer_ids');
49 | if (!is_array($indexerIds)) {
50 | $this->messageManager->addErrorMessage(__('Please select indexers.'));
51 | } else {
52 | try {
53 | $this->reindexStrategy->process($indexerIds);
54 | $this->messageManager->addSuccessMessage(
55 | __('Reindex triggered for %1 indexer(s).', count($indexerIds))
56 | );
57 | } catch (InputException | LocalizedException $e) {
58 | $this->messageManager->addExceptionMessage(
59 | $e,
60 | __("We couldn't reindex because of an error: {$e->getMessage()}")
61 | );
62 | } catch (Exception $e) {
63 | $this->messageManager->addExceptionMessage(
64 | $e,
65 | __("We couldn't reindex because of an error.")
66 | );
67 | }
68 | }
69 |
70 | $this->_redirect('*/*/list');
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | magepal
17 | MagePal_Reindex::config_magepal_reindex
18 |
19 | 1
20 |
21 |
23 | Copyright © 2025 MagePal, LLC
24 | Documentation
25 | Support
26 | Latest Version
27 | Extension Detail
28 | More Extensions
29 |
30 |
31 | ]]>
32 |
33 |
34 |
35 | MagePal\Core\Block\Adminhtml\System\Config\Composer\Version
36 |
37 |
38 |
39 | MagePal\Reindex\Block\Adminhtml\System\Config\Form\Field\Link
40 |
41 |
42 |
43 |
44 | MagePal\Reindex\Block\Adminhtml\System\Config\Source\Strategy
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Reindex Magento 2 / Adobe Commerce from Admin
4 |
5 | [](https://www.magepal.com/magento2/extensions/reindex.html)
6 | [](https://www.magepal.com/magento2/extensions/reindex.html)
7 |
8 | ##### For Magento 2.0.x, 2.1.x, 2.2.x and 2.3.x
9 |
10 | Reindexing your Magento 2 / Adobe Commerce store from Magento's admin has been removed and your only option is to set your indexes to "Update on Save" or reindex using SSH / CLI command line which is time-consuming. With our free Reindex module for Magento 2, you can quickly and easily update individual or all indexes from within your Magento admin. Ideal for project managers or QA department during site development and testing of new product and functionality. This module is not meant for large productions environment.
11 |
12 | 
13 |
14 | Indexes
15 |
16 | ```
17 | catalog_category_product Category Products
18 | catalog_product_category Product Categories
19 | catalog_product_price Product Price
20 | catalog_product_attribute Product EAV
21 | cataloginventory_stock Stock
22 | catalogrule_rule Catalog Rule Product
23 | catalogrule_product Catalog Product Rule
24 | catalogsearch_fulltext Catalog Search
25 | ```
26 |
27 | #### Magento Store Reindex Mode
28 | By default, you can set your store indexers to "Update on Save" or "Update by Schedule". Setting your Magento store to index on save will update your indexes when admin changes occur, while update by schedule only run at a set interval by your cron job. In your server cron must be set up correctly for "Update by Schedule" to work which must be set up by a developer, system admin or hosting company.
29 |
30 | ### Documentation
31 |
32 | - [How to Install Reindex for Magento2](https://www.magepal.com/help/docs/how-to-reindex-magento-2/#installation)
33 |
34 | - [How to setup Reindex for Magento2](https://www.magepal.com/help/docs/how-to-reindex-magento-2/#configuration)
35 |
36 | ### Installation Using Composer (recommended)
37 | ```
38 | composer require magepal/magento2-reindex
39 | ```
40 |
41 | #### How to reindex your Magento 2 / Adobe Commerce store from Command Line - One or more indexers are invalid
42 |
43 | Reindex Magento Data via SSH (from Magento root folder)
44 |
45 | > php bin/magento indexer:reindex
46 |
47 | Contribution
48 | ---
49 | Want to contribute to this extension? The quickest way is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).
50 |
51 |
52 | Support
53 | ---
54 | If you encounter any problems or bugs, please open an issue on [GitHub](https://github.com/magepal/magento2-reindex/issues).
55 |
56 | Need help setting up or want to customize this extension to meet your business needs? Please email support@magepal.com and if we like your idea we will add this feature for free or at a discounted rate.
57 |
58 | Magento 2 Extensions
59 | ---
60 | - [Custom SMTP](https://www.magepal.com/magento2/extensions/custom-smtp.html)
61 | - [Catalog Hover Image for Magento](https://www.magepal.com/magento2/extensions/catalog-hover-image-for-magento.html)
62 | - [Enhanced Success Page for Magento 2](https://www.magepal.com/magento2/extensions/enhanced-success-page.html)
63 | - [Enhanced Transactional Emails for Magento 2](https://www.magepal.com/magento2/extensions/enhanced-transactional-emails.html)
64 | - [Google Tag Manager](https://www.magepal.com/magento2/extensions/google-tag-manager.html)
65 | - [Enhanced E-commerce](https://www.magepal.com/magento2/extensions/enhanced-ecommerce-for-google-tag-manager.html)
66 | - [Reindex](https://www.magepal.com/magento2/extensions/reindex.html)
67 | - [Custom Shipping Method](https://www.magepal.com/magento2/extensions/custom-shipping-rates-for-magento-2.html)
68 | - [Preview Order Confirmation](https://www.magepal.com/magento2/extensions/preview-order-confirmation-page-for-magento-2.html)
69 | - [Guest to Customer](https://www.magepal.com/magento2/extensions/guest-to-customer.html)
70 | - [Admin Form Fields Manager](https://www.magepal.com/magento2/extensions/admin-form-fields-manager-for-magento-2.html)
71 | - [Customer Dashboard Links Manager](https://www.magepal.com/magento2/extensions/customer-dashboard-links-manager-for-magento-2.html)
72 | - [Lazy Loader](https://www.magepal.com/magento2/extensions/lazy-load.html)
73 | - [Order Confirmation Page Miscellaneous Scripts](https://www.magepal.com/magento2/extensions/order-confirmation-miscellaneous-scripts-for-magento-2.html)
74 | - [HTML Minifier for Magento2](https://www.magepal.com/magento2/extensions/html-minifier.html)
75 |
76 | © MagePal LLC. | [www.magepal.com](https://www.magepal.com "Magento 2.2 Extensions Marketplace")
77 |
--------------------------------------------------------------------------------