Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Reindexing via Command Line
 
Anshu Mishra
Sr. Member
 
Total Posts:  101
Joined:  2012-04-23
India
 

First move to [MAGENTO_ROOT]/shell/ (This is the location where indexer.php is present.)

To check the status of all Indexes

php indexer.php --status

To Reindex all indexes

php indexer.php --reindexall

To Reindex particular index

php indexer.php --[Index Option Code]

Index Option Code                             Index Option Name 
catalog_product_attribute                Product Attributes
catalog_product_price                      Product Prices
catalog_url                                          Catalog Url Rewrites
catalog_product_flat                         Product Flat Data
catalog_category_flat                       Category Flat Data
catalog_category_product               Category Products
catalogsearch_fulltext                      Catalog Search Index
cataloginventory_stock                    Stock status
 
Magento Community Magento Community
Magento Community
Magento Community
 
elMarquis
Jr. Member
 
Total Posts:  14
Joined:  2011-09-15
 

When reindexing a particular index, be sure and have --reindex before your index option code

php indexer.php --reindex [Index Option Code]

It’s also possible to specify a selection of indexes by separating them with a comma.

php indexer.php --reindex catalog_product_price,catalog_url,catalog_product_flat
 
Magento Community Magento Community
Magento Community
Magento Community
 
ravenlandz
Jr. Member
 
Total Posts:  1
Joined:  2014-01-06
 

[root@server public_html]# php -f shell/indexer.php --status
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
php [options]—[args...]
php [options] -a

-a Run as interactive shell
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value ‘bar’
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-s Output HTML syntax highlighted source.
-v Version number
-w Output source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.

args… Arguments passed to script. Use—args when first argument
starts with - or script is read from stdin

--ini Show configuration file names

--rf <name> Show information about function <name>.
--rc <name> Show information about class <name>.
--re <name> Show information about extension <name>.
--ri <name> Show configuration for extension <name>.

[root@server public_html]#

Did I type something wrong? :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
christinavick
Guru
 
Total Posts:  355
Joined:  2013-11-13
 

Hi,

You can also check this thread http://www.atwix.com/magento/process-magento-indexes-from-command-line/

Hope this will help you!!

Thanks

iLoveMage

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidvzero
Jr. Member
 
Total Posts:  1
Joined:  2013-05-01
 
ravenlandz - 06 January 2014 08:57 PM

[root@server public_html]# php -f shell/indexer.php --status
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
[root@server public_html]#

Did I type something wrong? :(

When you are using the ‘ -f ‘ switch with php you need to add a double ‘--’ dash between shell/indexer.php and --status like

php -f shell/indexer.php -- --status

Here is an updated (more complete) indexer:
https://github.com/dgvigil/magento-utils/tree/master/shell
betterIndexer.php

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top