手动刷新magento的索引管理方法

当我们网站商品很多的时候,比如有几千件,我们刷新Magento的索引管理(Index Management)经常会失败。那么后台刷新不了,我们还可以通过命令行来刷新。

        使用命令行来刷新索引管理会极大降低系统消耗,容易成功。

我们来看下步骤,如果你在使用linux服务器,登入你的ssh客户端,切换目录到你magento根文件夹中名字是shell的文件中。(切换文件夹的命令:cd)
        在此文件夹中输入如下命令

        php -f indexer.php -- -reindex catalog_url

 它的意思是刷新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_summary

其它扩展:

        在magento中,reindex是经常需要使用的功能, 这个功能除了可在后台直接使用外,还能通过一个magento自带的脚本运行,这个脚本的位置在shellindexer.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  

        但实际发现这个命令是没法运行的。

       

原文地址:https://www.cnblogs.com/focai/p/4693767.html