当咱们网站商品不少的时候,好比有几千件,咱们刷新Magento的索引管理(Index Management)常常会失败。那么后台刷新不了,咱们还能够经过命令行来刷新。php
使用命令行来刷新索引管理会极大下降系统消耗,容易成功。linux
咱们来看下步骤,若是你在使用linux服务器,登入你的ssh客户端,切换目录到你magento根文件夹中名字是shell的文件中。(切换文件夹的命令:cd)
在此文件夹中输入以下命令
php -f indexer.php -- -reindex catalog_urlshell
它的意思是刷新Catalog Url Rewrites即网址重写。成功后会有成功提示,如:Catalog URL Rewrites index was rebuilt successfully
使用命令
php -f indexer.php help
能够获得有关命令的使用帮助,具体参数用法能够参照帮助实践。
具体命令以下:
php -f indexer.php -- -reindex catalog_product_attribute
php -f indexer.php -- -reindex catalog_product_price
php -f indexer.php -- -reindex catalog_url
php -f indexer.php -- -reindex catalog_product_flat
php -f indexer.php -- -reindex catalog_category_flat//不是常常刷新
php -f indexer.php -- -reindex catalog_category_product
php -f indexer.php -- -reindex catalogsearch_fulltext
php -f indexer.php -- -reindex cataloginventory_stock服务器
php -f indexer.php -- -reindex tag_summaryssh
其它扩展:网站
在magento中,reindex是常常须要使用的功能, 这个功能除了可在后台直接使用外,还能经过一个magento自带的脚本运行,这个脚本的位置在shell\indexer.php。
脚本的三个经常使用选项以下:
(1)查看哪些选项能够reindex
php indexer.php info
第一项是参数值,第二项是这个值的解释(也就和在后台上看到的同样)
(2)reindex 所有选项
php indexer.php reindexall
(3)reindex 其中的某一项
php indexer.php --reindex cataloginventory_stock
参数值可经过(1)查得
注意了,在reindex.php 的帮助中提示命令的格式应该以下:
php -f indexer.php --reindex cataloginventory_stock
但实际发现这个命令是无法运行的。ui