Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

118

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


118

You can reset the indexer through command line with indexer:reset command. This will give the list of indexes name: php bin/magento indexer:info Output: design_config_grid Design Config Grid customer_grid Customer Grid catalog_category_product Category Products catalog_product_category ...


39

step 1 : cd [MAGENTO_ROOT]/shell/ You should replace [MAGENTO_ROOT] with your own absolute path to Magento root folder. For example /home/Thief/public_html/ Then list all files to see what we have here. Just enter simple command: step 2 : ls -l If you can find something like ‘indexer.php‘, that’s what we need and we can go on. To see the status of all ...


22

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


20

Looks like some error happened in the process of re-index and index status left processing. You need to reset it DB. For example by query: update indexer_state set status = 'invalid' where status != 'valid'; Then run: php -f bin/magento indexer:reindex


19

You can use Go to shell folder and run this cmd php indexer.php --reindexall For separate php yourmagentofolder/shell/indexer.php -reindex catalog_product_attribute php yourmagentofolder/shell/indexer.php -reindex catalogsearch_fulltext php yourmagentofolder/shell/indexer.php -reindex catalog_category_flat php yourmagentofolder/shell/indexer.php -...


18

I had the same issue. It appeared to be caused by some Entity IDs that needed to be set to 0. When you transfer the data the insert records on these specific records are automatically generated and tend to start at 1 and not 0. This script worked for me: SET FOREIGN_KEY_CHECKS=0; UPDATE `store` SET store_id = 0 WHERE code='admin'; UPDATE `store_group` ...


16

Magento 2 not showing customers in backend grid: Run the below commands for fix 1) php bin/magento indexer:reset customer_grid 2) php bin/magento indexer:reindex customer_grid Thanks!


15

How to interpret the error message SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2828-148-1-471' for key 'PRIMARY In the case of the product attribute indexer, this means there's a constraint error while saving a record to the catalog_product_index_eav_idx table. 2828-148-1-471 refers to: product entity id: 2828 attribute id: ...


14

If you update stock options of products you can reindex "Stock Status" tables programmatically: try { $indexer = Mage::getModel('index/indexer')->getProcessByCode('cataloginventory_stock'); $indexer->reindexEverything(); } catch (Exception $e) { //Some error handling } To get indexer model use Mage::getModel('index/...


11

There should be no difference.


10

Not sure if this is too late to add, but when I had this It appeared to be caused by some entity ids that needed to be set to 0. This script worked for me: SET FOREIGN_KEY_CHECKS=0; UPDATE `store` SET store_id = 0 WHERE code='admin'; UPDATE `store_group` SET group_id = 0 WHERE name='Default'; UPDATE `store_website` SET website_id = 0 WHERE code='admin'; ...


10

Mainly you need to fire product related indexing. So you need to initialize IndexerFactory following way. /** * @var \Magento\Indexer\Model\IndexerFactory */ protected $indexerFactory; public function __construct( \Magento\Indexer\Model\IndexerFactory $indexerFactory ) { $this->indexerFactory = $indexerFactory; } ...


10

When I faced this kind of situation I had to run the following SQL query directly into the database: UPDATE indexer_state SET status = 'valid'; I was not able to to find any option to force reindexing when an index has failed previously.


10

You can launch reindex a separate index as independent process, like: * * * * * /usr/bin/php /Users/uchuhlebov/web/m212/www/bin/magento indexer:reindex catalog_category_product >> /Users/uchuhlebov/web/m212/www/var/log/indexer.cron.log Where: * * * * * - time /usr/bin/php - path to the php /Users/uchuhlebov/web/m212/www/bin/magento - path to your ...


9

In Magento Enterprise 1.13 (or 1.12) url_key attribute was moved to its own table catalog_category_entiry_url_key (similarly product url_key attribute has its own table catalog_product_entiry_url_key). Also in 1.13 indexers were changed and are now run by the cronjob instead of manually. The problem is that indexer only takes values from ...


9

You can fix this from the command line by reseting the index which will invalidate the state of the index and remove the processing flag from the index. php bin/magento indexer:reset Optionally you may also append the index name to the command to just just reset that index.


8

Do not truncate: core_url_rewrite This is the worst advice ever, you will lose all customized SEO urls! Just dont do it! What worked for me was SSH and running: php -f ./shell/indexer.php -- -reindex catalog_url If nothing else works then maybe attempt the table dropping idea, but only as a last resort!


7

Below solution worked for me and may help others : 2828-148-1-471 refers to: product entity id: 2828 attribute id: 148 store id: 1 value: 471 Just open product with id 2828 and save it and reindex again. that may solve your problem


7

it seams that you have zombie data in the flat table for store with id 1. The prepareFlatTable method is trying to add a Foreign Key to the catalog_product_entity table and that fails. Most probably because you already have in the catalog_product_flat_store_1 table a product id that is not in the catalog_product_entity table. First backup your database (...


7

In addition to Raphael: I Debugged this code with altering the exception constructor for debug purposes (either by xdebug or old dumps). Alter the construct of the exception for now (the file is \lib\internal\Magento\Framework\Exception\NoSuchEntityException.php) $trace = debug_backtrace(); var_dump($trace[1]['class'] . '::' . $trace[1]['function'] . '('.$...


7

if you are using windows then run this command in cmd C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex and if you want to reindex only one indexer then write following command: C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex indexer_name. where indexer_name can be found by ...


7

You can find a fix in Magento 2 GitHub. The issue is present on 2.1.5. https://github.com/magento/magento2/issues/8018 One of the soulution is to add a preference <preference for="Magento\Catalog\Model\Indexer\Category\Product\Action\Full" type="<My>\<Module>\Model\Indexer\Category\Product\Action\Full" /> And override the limit of 500 ...


6

You can't add tasks via the scheduler. It only represents tasks set in the <crontab> tag in other modules config.xml files. To reindex use the servers crontab and add a task like 15 9 * * * php /path/to/website/shell/indexer.php reindexall This task will run the Indexer on all indexes every day at a quarter pas nine


6

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 ...


6

Best option is to reset and then reindex via CLI php bin/magento indexer:reset customer_grid php bin/magento indexer:reindex customer_grid


6

Try This. open cmd and run it as administrator. C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex hope this will help you.


6

On MySQL run: SET SQL_SAFE_UPDATES = 0; update indexer_state set status = 'invalid' where status != 'valid'; Then on your terminal run: php bin/magento indexer:reindex It normally happens when the memory limit is few, so increase on your .htaccess or NGINX config.


6

You can check via command line: php bin/magento i:status


5

The catalog_product_index_eav table has a foreign key contraint named FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT_ID Looking at this table's definition CREATE TABLE `catalog_product_index_eav` ( `entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID', `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID', `...


Only top voted, non community-wiki answers of a minimum length are eligible