手动刷新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自带的脚本运行,这个脚本的位置在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  

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

       

 

转载于:https://www.cnblogs.com/focai/p/4693767.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值