问题
I'm not able to do reindexing in magento 2. After google I get the solution that We can reindex with shell command
php dev/shell/indexer.php reindexall
But it's giving error
Could not open input file: dev/shell/indexer.php
As I can't see shell folder within dev.
回答1:
fire this command from magento root via terminal
reindex all : php bin/magento indexer:reindex
reindex perticuler : php bin/magento indexer:reindex indexer_name
Where indexer_name Should be catalog_category_product,catalog_product_category,catalog_product_price,catalog_product_attribute,cataloginventory_stock,catalogrule_rule,catalogrule_product,catalogsearch_fulltext.
回答2:
In your root magento directory type this:
php bin/magento indexer:reindex
This will perform a full reindex. If you wish to reindex only one of the indexers, command is as follows:
php bin/magento indexer:reindex indexer_name
where indexer_name can be found by typing:
php bin/magento indexer:info
回答3:
Using command prompt,
go to your Magento root directory.
cd your_magento_directory
Then run following command
php bin/magento indexer:reindex
If you want to do reindex specifically, then your comment will be:
php bin/magento indexer:reindex [indexer]
回答4:
This works for me.
You can manually run reindex. Go to your magento bin folder in root of magento install folder and run: $ php magento indexer:reindex
Reference: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html
The better way is to config cronjob. follow the guide here: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg
Magento2 is designed to not have manually reindex in admin. Refer to: https://github.com/magento/magento2/issues/824
回答5:
http://devdocs.magento.com/guides/v2.0/comp-mgr/prereq/prereq_compman-ulimit.html Set ulimit for the web server user
To optionally set the value in the user’s Bash shell:
If you haven’t done so already, switch to the Magento file system owner. Open /home//.bashrc in a text editor. Add the following line:
ulimit -s 65536 Save your changes to .bashrc and exit the text editor.
回答6:
In magento2 they don't have an indexer.php under shell directory.
If you run magento cron:run
twice it will rebuild the indexes.
Command line interface
Reindex CLI
回答7:
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.
You can look more info in magento core document link: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html
回答8:
That's correct. To keep indexers up-to-date, run cron as the Magento file system owner.
One way is to set up a crontab for that user:
*/1 * * * * php <your Magento install dir>/bin/magento cron:run &
Details: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html
回答9:
If you using xampp on Linux, CLI command would be
/opt/lampp/bin/php bin/magento indexer:reindex
回答10:
For windows system you have to follow the below steps :
step:1 Create environment variable as
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).
Step:2 Open CMD and run the below command on the root folder of your Magento project
php bin/magento indexer:reindex
回答11:
You can Re-Index Magento 2 with two methods.
1- Re-Index through Admin Panel
To do so, after Login to your Magento Login
Go to System > Tools > Index Management
Select the checkbox next to each type of indexer to change
Select the indexing mode from the Action Dropdown
And Click Submit
2- Re-Index Using CLI
Run the following Command to Re-Index Magento 2
Bin / magento indexer : reindex [indexer]
By running the following line of code you can view the List of Indexers.
bin / magento indexer:info
By applying the following code you can check the Indexer Status. Sometimes the re-index command doesn’t update all indexers.
bin / magento indexer : status
You can also read this Article for more Detail - https://www.fmeextensions.com/blog/magento-2-reindex-from-admin/
来源:https://stackoverflow.com/questions/33479082/magento-2-reindexing-is-not-working