What is indexing?
Magento is software for online shops. A store can hold thousands of products. To show them fast, Magento keeps neat lookup lists called indexes. They work like the index at the back of a book. When you change a price or add a product, the index must be updated. If it is not, the shop may show old prices or miss new items. Reindexing rebuilds those lists.
SSH is a safe way to type commands on your server. You need SSH access on your plan. Ask Hostvento support if you are not sure it is on.
Steps
- Connect to your server:
ssh username@your-server-ip
- Go to your Magento folder. Use your own path:
cd /home/username/public_html
- See the state of all indexes:
php bin/magento indexer:status
Each line shows an index name and whether it is valid or needs a reindex.
- Rebuild all indexes:
php bin/magento indexer:reindex
This can take several minutes on a big store.
- To rebuild only one, give its name:
php bin/magento indexer:reindex catalog_product_price
- Clear the cache so the new data shows:
php bin/magento cache:flush
- Run
indexer:statusagain and check that all say Ready.
See the list of index names
php bin/magento indexer:info
This lists every index you can pick.
Update on save or on schedule
Magento can update indexes two ways. Update on Save does it at once when you save a change. Update by Schedule does it in the background with cron (a timer on the server). You can see or set it:
php bin/magento indexer:show-mode
php bin/magento indexer:set-mode schedule
Scheduled mode is better for large stores. It needs cron to be working.
Common problems
- Permission denied: run the command as the same user that owns the Magento files.
- Memory error: run with more memory, for example
php -d memory_limit=2G bin/magento indexer:reindex. - Index "locked": another run may be in progress. Wait and try again.
Quick recap
- Indexes keep a Magento shop fast and correct.
- Use
indexer:statusto check them. - Use
indexer:reindexto rebuild them. - Flush the cache afterwards.