How to use asynchronous reindexing
To manage indexes, navigate to Index management section.
Managing indexes
From Actions drop-down menu, you can select mass-actions that can be performed on selected indices:
- Update on save: set mode of selected indices to Update on Save mode.
- Update by schedule: set mode of selected indices to Update on Schedule mode.
- Invalidete index: mark the selected indices as invalid. Magento will require them to be reindexed before data can be used.
- Reindex: run a reindex of the selected indices immediately.
- Schedule full reindex: schedule selected indices to the next run of our cron task.
- Run full reindex: perform full reindex on selected indices.
- Reindex pending items: our extension runs reindex only for those chunks of reindexed data which have been changed. This action is useful when a reindex is needed for very large indices.
note
If you have scheduled a reindex, but also run this action - it does not cancel the schedule, since data will be updated only partially.
Managing Crontasks
Our extension adds two new cron tasks that will help you to manage your indices. They are:
- indexer_reindex_scheduled - runs reindex on scheduled indices (see above for details).
- indexer_validate - validates indexed data.
note
For now, only the products' data is validated.
These cron tasks are executed every second by default. The reindex queue is accompanied by a special lock-file indexer.cli.lock, located in the /var/tmp by default. It prevents conflicts when a previous reindexing cron task is not finished, but a new one has already started.
If you wish to adjust the time of reindexing schedule (for example, for performance tuning), you need to manually adjust crontab in this config XML file:
/src/vendor/mirasvit/module-indexer/src/Indexer/etc/crontab.xml
- Find the task names corresponding to cron in this file
<job>tag mentioned above, and in the<schedule>child tag adjust execution period. - Then run the
bin/magento setup:upgradecommand, clean cache, and regenerate static content to apply all changes.