Ramesh Kumar
Ramesh Kumar

Reputation: 542

Magento 2: reindexing is not working

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.

Upvotes: 7

Views: 25339

Answers (10)

Patrick-Peng
Patrick-Peng

Reputation: 31

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.

Upvotes: 1

Pratik Kamani
Pratik Kamani

Reputation: 758

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.

Upvotes: 16

Amit Naraniwal
Amit Naraniwal

Reputation: 1420

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

Upvotes: 0

Ajitha Ms
Ajitha Ms

Reputation: 555

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] 

Upvotes: 2

Kumar A.
Kumar A.

Reputation: 330

If you using xampp on Linux, CLI command would be

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

Upvotes: 0

Steve Johnson
Steve Johnson

Reputation: 369

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

Upvotes: 0

Wenping Guo
Wenping Guo

Reputation: 682

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

Upvotes: 1

VIPIN A ROY
VIPIN A ROY

Reputation: 1781

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

Upvotes: 6

Rakesh Jesadiya
Rakesh Jesadiya

Reputation: 448

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

Upvotes: 0

Andr&#233; Ferraz
Andr&#233; Ferraz

Reputation: 1521

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

Upvotes: 0

Related Questions