设为首页 收藏本站
查看: 847|回复: 0

[经验分享] 使用命令行刷新Magento索引管理 Rebuilt Magento Indexes in terminal with php-cli

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2017-4-11 07:40:29 | 显示全部楼层 |阅读模式
DSC0000.png
magento索引管理


  当我们网站商品很多的时候,比如有几千件,我们刷新Magento的索引管理(Index Management)经常会失败。那么后台刷新不了,我们还可以通过命令行来刷新。使用命令行来刷新索引管理会极大降低系统消耗,容易成功。

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

在此文件夹中输入如下命令

php -f indexer.php -- -reindex catalog_url
   它的意思是刷新Catalog Url Rewrites即网址重写。成功后会有成功提示,如:Catalog URL Rewrites index was rebuilt successfully


DSC0001.png
 
magento使用Shell刷新索引管理
 


  我们来看下有哪些索引管理,可以使用Shell的命令行来刷新,如下


1

2

3

4

5

6

7

8


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








  如上分别对应后每项台的索引管理。
  命令执行后需要耐心等待一段时间,因你商品数量和你服务器性能决定等待多久。注意命令中reinde前一共是三个英文横线。如有代码错误提示,直接黏贴本文的命令或者

如下参考文章的命令,直接修改执行参数即可。
  来源: http://www.hellokeykey.com/magento-shell-reindex-index-management/
  
参考文章:http://inchoo.net/ecommerce/magento/executing-magento-indexer-from-shell/



Rebuilt Magento Indexes in terminal with php-cli



For
the past 6 months, had been doing a lot of work with Magento. I’ve
notice that the more I know the whole thing, the more I don’t want to
share about it. Well, I still like to share some things though… so now
it’s time to give some tips/tricks…

 
In your terminal do:


cd /magento/shop/path/shell/
 
where “/magento/shop/path” is your magento rooth path. For e.g. (in live terminal)


user:~$ cd /home/cliper/magento/shell/
 
after that, you can run the indexer by doing:


php indexer.php reindex all
 
that will re-index all available indexes in magento.

Well, you can always run it in one command like:


php /home/cliper/magento/shell/indexer.php reindex all
 
For help on how to use the indexer and available arguments do:


php indexer.php
 
For a list of available indexes do:


php indexer.php info
 
and you should be able to see a list of indexes something like this:


catalog_product_attribute     Product Attributes
catalog_product_price         Product Prices
...                           ...
 
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-363103-1-1.html 上篇帖子: Blumentals 三剑客 Rapid PHP、Rapid CSS、HTMLPad 2010 汉化发布 下篇帖子: 韩顺平_PHP从入门到精通视频教程配套笔记
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表