Re-Indexing Magento with SSH

Re-Indexing Magento with SSH

Liam Firth

If you’re unfamiliar with the Magento platform, indexing is a fundamental operation that can have a serious impact on how your store performs on a day-to-day basis. This eCommerce platform uses an EAV or Entity-Attribute-Value database structure.  This means that you will often need to carry out heavy database queries to retrieve simple results.  To try and improve this process, Magento developers have created index tables that have the ability to query and store all of your data in a single table structure.  This makes it super easy for users to query a singular Index table, rather than having to run a number of complex queries that cover a number of different tables.

If you’re finding it a little difficult to keep up with this concept, indexing in simpler terms will not alter the data in your database.  Indexing simply refers to the transfer of data relating to products, users and categories.  Indexing this data into a more efficient table system will significantly improve the effectiveness and overall speed of your store.  To achieve this, your Magento store has indexers that are special objects.  It is recommended that you re-index every time you modify the data in your database.  For example, if a price on your store changes, it is best to re-index this change so your storefront will display the latest price.

How to Re-Index Your Magento Store

This is a simple procedure.  All you need to do is visit the Admin Panel.  From there, you can go to System > Index Management.  You will then be able to check all of your indexes that you need to re-index and then submit your request.

Your store will also include an indexing script called ‘indexer.php’.  This can be found in the MAGENTO_ROOT/shell folder.  You can use this specific shell script to re-index any of your data using CLI or SSH.

If you want to use this script, you will need to access the SSH Terminal.  From there you can access the MAGENTO_ROOT/shell.  To use the special indexer.php shell script, you will need to use the command ‘php indexer.php help.’  You will then be able to check the status of all your indexes.  Each of the different indexes has its own index key that you will need to reference when re-indexing in Magento.

You also have the option to initiate a blanket re-index across your Magento store.  We would not suggest you use this option as it can often cause a Server overload.  This process can cause your database to LOCK on certain tables.

Why You Should Re-Index Your Magento Store

Magento users should always take the time to re-index their store.  This is because Index Management is an essential activity of your day-to-day online activity.  Also, as the store administrator, it’s important that you take the time to learn about how you can re-index Magento using the SSH terminal.

We hope this post will prove helpful if you are looking to re-index your Magento store.  Let us know about your re-indexing experience in the comments below.

Liam Firth

Author Liam Firth

More posts by Liam Firth