我无法在magento 2中重建索引.谷歌之后,我得到了解决方案,我们可以使用shell命令重新索引
php dev/shell/indexer.php reindexall
Run Code Online (Sandbox Code Playgroud)
但它给出了错误
Could not open input file: dev/shell/indexer.php
Run Code Online (Sandbox Code Playgroud)
因为我在dev中看不到shell文件夹.
Pra*_*ani 15
通过终端从magento root发出此命令
reindex all: 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.
在根magento目录中输入以下内容:
php bin/magento indexer:reindex
这将执行完整的重新索引.如果您只想重新索引其中一个索引器,命令如下:
php bin/magento indexer:reindex indexer_name
通过键入以下内容可以找到indexer_name:
php bin/magento indexer:info