【问题标题】:Magento 2: reindexing is not workingMagento 2:重新索引不起作用
【发布时间】:2016-02-02 10:08:46
【问题描述】:

我无法在 ma​​gento 2 中进行重新索引。谷歌后,我得到了我们可以用 shell 命令重新索引的解决方案

php dev/shell/indexer.php reindexall

但它给出了错误

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

因为我在 dev 中看不到 shell 文件夹。

【问题讨论】:

标签: magento magento2


【解决方案1】:

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

命令行界面

Reindex CLI

【讨论】:

    【解决方案2】:

    没错。要使索引器保持最新状态,请将 cron 作为 Magento file system owner 运行。

    一种方法是为该用户设置一个 crontab:

    */1 * * * * php <your Magento install dir>/bin/magento cron:run &
    

    详情:http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

    【讨论】:

      【解决方案3】:
      shell folder are reside under dev directory of magento2 root.
      Open your cmd.
      go to magento bin directory path using CLI.
      Your path like C:\wamp\www\magento2\bin.(if wamp is installed on C directory)
      Now You have to enter command php magento indexer:reindex
      All indexing are successfully reindex.
      

      您可以在 magento 核心文档链接中查看更多信息:http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html

      【讨论】:

        【解决方案4】:

        这对我有用。

        您可以手动运行重新索引。转到magento安装文件夹根目录中的magento bin文件夹并运行: $ php magento 索引器:重新索引

        参考: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

        【讨论】:

          【解决方案5】:

          在您的根 magento 目录中输入:

          php bin/magento indexer:reindex

          这将执行完整的重新索引。如果您只想重新索引其中一个索引器,命令如下:

          php bin/magento indexer:reindex indexer_name

          可以通过键入找到 indexer_name 的位置:

          php bin/magento 索引器:信息

          【讨论】:

          • 我们不能通过magento admin来做吗?
          • 在 Magento 2 中,我没有找到任何通过管理员重新索引的选项。
          【解决方案6】:

          通过终端从 magento root 启动此命令

          重新索引所有:php bin/magento indexer:reindex

          reindex perticuler : php bin/magento indexer: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。

          【讨论】:

            【解决方案7】:

            如果你在 Linux 上使用 xampp,CLI 命令将是

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

            【讨论】:

              【解决方案8】:

              使用命令提示符,

              转到您的 Magento 根目录。

              cd your_magento_directory
              

              然后运行以下命令

              php bin/magento indexer:reindex
              

              如果您想专门进行重新索引,那么您的评论将是:

              php bin/magento indexer:reindex [indexer] 
              

              【讨论】:

                【解决方案9】:

                对于 windows 系统,您必须按照以下步骤操作:

                步骤: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
                

                【讨论】:

                  【解决方案10】:

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

                  选择在用户的 Bash shell 中设置值:

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

                  ulimit -s 65536 将更改保存到 .bashrc 并退出文本编辑器。

                  【讨论】:

                  • 我不确定..你在说什么
                  猜你喜欢
                  • 1970-01-01
                  • 1970-01-01
                  • 2021-09-11
                  • 1970-01-01
                  • 2017-03-02
                  • 2014-12-19
                  • 1970-01-01
                  • 1970-01-01
                  相关资源
                  最近更新 更多