Magento 2 Reindexing - One or more indexers are invalid. Make sure your Magento cron job is running

52

12

I couldn't find the way to do reindexing in mass actions on magento 2.

Seems like you need to run it from cronjob. Is there an alternative way to reindex data in magento 2 from backend or command line just like it used to be in Magento 1.x (php shell/indexer.php -reindexall) ?

enter image description here

Harit

Posted 2015-11-18T11:00:58.527

Reputation: 478

sorry but i am new in Magento. I have installed Magento locally to XAMPP, i am using Windows 7,and i would like to ask what can i do?? i get the same message, – Alex4842 – 2015-11-20T18:05:13.947

@Alex4842 same thing here. Running Magento on Win 10. Found this: https://magento.stackexchange.com/questions/111132/magento-in-xampp-server-localhost-indexerreindex

– MJoraid – 2017-07-01T10:15:45.837

Answers

84

to reindex in magento 2, go to the CLI and then the root folder of your magento installation and run the below command :

php bin/magento indexer:reindex

Manashvi Birla

Posted 2015-11-18T11:00:58.527

Reputation: 5 083

1

Just figured out from here http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-index.html

– Harit – 2015-11-18T11:03:30.470

For those who are using mac, they can change directory to installation_dir/bin and write this command ./magento indexer::reindex – Harit – 2015-11-18T11:04:49.173

2It says you can accept in 3 minutes xD – Harit – 2015-11-18T11:13:01.570

I am getting parse error in /Applications/MAMP/htdocs/Magento-CE-2.1.2-2016-10-11-11-16-47/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 – Oli Tuck – 2016-10-16T16:22:29.370

And the reindex isnt working, why is this happening? – Oli Tuck – 2016-10-16T16:22:40.627

By the way, you can leave the 'php' command out. Calling bin/magento indexer:reindex does the same. Might save some time if you're using CLI extensively :) – Jacco Amersfoort – 2016-11-28T16:46:38.210

13

Run this command in your CLI

php bin/magento indexer:reindex

and if you want to reindex only one indexer then write following command:

php bin/magento indexer:reindex indexer_name.

where indexer_name can be found by typing following command :

php bin/magento indexer:info

MaYaNk

Posted 2015-11-18T11:00:58.527

Reputation: 1 518

4

Use Magento CLI. Run php bin/magento indexer:reindex from project root directory.

Alex Paliarush

Posted 2015-11-18T11:00:58.527

Reputation: 9 012

1

Here is how you can get things done using Magento 2 CLI indexing commands

Get into your Magento CLI command file available in Magento/bin directory cd magento_folder/bin and run your comamnd directly using magento in terminal or putty.

Here is how it will work for indexing in Magento 2

Get list of available indexer in Magento 2

php bin/magento indexer:info

How to check status of indexer

Following command will get you the status of all the indexer whether indexing is required or ready.

php bin/magento indexer:status

You can also check status of individual indexer: let say i want to check status of catalog_category_product

php bin/magento indexer:status catalog_category_product

How to reindex all available indexing in Magento 2

php bin/magento indexer:reindex

In case you fill memory limit, try this command

php bin/magento -dmemory_limit=2G magento indexer:reindex

Yogesh Trivedi

Posted 2015-11-18T11:00:58.527

Reputation: 1 577

1

If any index is looping You can reset all index by using
indexer:reset
then use normal reindex

Konrad Siamro

Posted 2015-11-18T11:00:58.527

Reputation: 831

1

To Reindex from command prompt run below command:

php bin/magento indexer:reindex

Above command should be run from magento root directory

Sheshgiri Anvekar

Posted 2015-11-18T11:00:58.527

Reputation: 579

0

Alternative solution add php bin/magento indexer:reindex command at cronjob.

I have follow this and it has been working at my system

Amit Bera

Posted 2015-11-18T11:00:58.527

Reputation: 48 624

0

solved with php bin/magento indexer:reindex

khan

Posted 2015-11-18T11:00:58.527

Reputation: 76