vuestorefront / magento2-vsbridge-indexer

This is official Vue Storefront, native, Magento2 indexer
https://vuestorefront.io
MIT License
69 stars 89 forks source link

Feature Request: Trigger Full Reindex from Magento Admin Backend #400

Open simonmaass opened 2 years ago

simonmaass commented 2 years ago

It would be great if there was a button in the config to trigger a full reindex:

image

clinton-origin commented 2 years ago

@simonmaass I just created my own module to do it. It's just a simple magento ajax button that executes the below. Also in the same module we have a button that clear the Redis cache as well. Let me know if you want the module.

public function execute() { try { $command = 'php bin/magento vsbridge:reindex --all'; exec($command); } catch (\Exception $e) { $result = $this->resultJsonFactory->create(); return $result->setData(['success' => true, 'message' => $e]); }

    $message = 'done';
    /** @var \Magento\Framework\Controller\Result\Json $result */
    $result = $this->resultJsonFactory->create();

    return $result->setData(['success' => true, 'message' => $message]);
}
simonmaass commented 2 years ago

@clinton-origin oh that would be awesome if you could share it :)

clinton-origin commented 2 years ago

@simonmaass Here you go

https://github.com/clinton-origin/Magento-2-Cache-Cleaner

Just replace "Origin" with whatever you like in the system.xml file. This will show a tab in the Store > Config section

simonmaass commented 2 years ago

thank you!