2015-11-02 61 views
6

我无法做reindexingmagento 2。谷歌之后,我得到的是我们可以用shell命令Magento 2:reindexing不工作

php dev/shell/indexer.php reindexall 

重新索引的解决方案,但它给错误

Could not open input file: dev/shell/indexer.php 

正如我不能看到开发外壳文件夹。

+0

由于Stack Overflow是一个与程序相关的问答网站,因此我正在投票关闭这个问题。你的问题不是关于编程。也许你应该在http://magento.stackexchange.com/上发布它? – Enigmativity

+0

@Enigmativity,这是一个编程问题,因为索引与magento 2不兼容 –

+0

除非你正在用你正在编写的索引替换索引,否则这是一个服务器管理练习。 – Enigmativity

回答

14

火经由终端

从magento的根这个命令210

编制所有:PHP斌/ Magento的索引:REINDEX

重新索引perticuler:PHP斌/ Magento的索引:REINDEX indexer_name

indexer_name应该是 catalog_category_product,catalog_product_category,catalog_product_price,catalog_product_attribute, cataloginventory_stock,catalogrule_rule,catalogrule_product,catalogsearch_fulltext。

+0

这是工作和测试.. –

0

在magento2中,它们在shell目录下没有indexer.php。 如果您运行magento cron:run两次,它将重建索引。

命令行界面

Reindex CLI

1

这为我工作。

您可以手动运行reindex。去你的Magento bin文件夹在Magento的根文件夹,然后运行: $ PHP Magento的索引:REINDEX

参考:http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html

的更好的办法是配置的cronjob。请按照这里的指南:http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg

Magento2被设计为没有手动重新管理。请参阅:https://github.com/magento/magento2/issues/824

6

在你的根目录的Magento此类型:

PHP斌/ Magento的索引:REINDEX

这将执行完全重新索引。如果你想重新索引只索引中的一个,命令如下:

PHP斌/ Magento的索引:REINDEX indexer_name

其中indexer_name可以通过键入发现:

PHP斌/ magento的索引:信息

+0

它为我工作 –

+0

我们不能通过magento管理员吗? –

+0

在Magento 2中,我没有找到任何通过管理员重新索引的选项。 –

0

如果您在Linux上使用XAMPP,CLI命令将

/opt/lampp/bin/php bin/magento indexer:reindex 
2

使用命令提示符,

去你的Magento的根目录。

cd your_magento_directory 

如果你想要做重新索引具体来说,那么你的评论将被下面的命令

php bin/magento indexer:reindex 

然后运行:

php bin/magento indexer:reindex [indexer] 
+0

它已经工作.... thnx您的回应 –

0

对于windows系统,你必须遵循以下步骤:

step:1创建环境变量为

Go to My Computer -> Right Click -> Properties -> Advanced System Settings -> Advanced -> Environment Variable -> System Variable -> Path -> Edit -> Enter you xampp->php path (Example : E:\xampp\php). 

第2步:打开CMD,并在你的Magento项目的根文件夹中运行以下命令

php bin/magento indexer:reindex 
1

http://devdocs.magento.com/guides/v2.0/comp-mgr/prereq/prereq_compman-ulimit.html 设置的ulimit Web服务器用户

任意设定的值用户的Bash shell:

如果您还没有这样做,请切换到Magento文件系统所有者。 在文本编辑器中打开/home//.bashrc。 添加以下行:

ulimit -s 65536 保存您对.bashrc的更改并退出文本编辑器。

+0

我不确定..你在说什么 –