-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reindex EAV values only for active storeviews #2651
Reindex EAV values only for active storeviews #2651
Conversation
When enable/disable a store, we should display a notice that reindixing is required (or run it automatically)? |
@sreichel got a point, we should change the process's status to |
hey guys, good idea, I just added a commit that sets |
Functionality wise, all works well for me. But I'd prefer if the code that changes process status was inside the indexer model ( protected $_matchedEntities = [
...
Mage_Core_Model_Store::ENTITY => [
Mage_Index_Model_Event::TYPE_SAVE
]
]; then changing the status inside the ...
} elseif ($entity == Mage_Core_Model_Store::ENTITY) {
if ($event->getType() === Mage_Index_Model_Event::TYPE_SAVE) {
/** @var Mage_Core_Model_Store $store */
$store = $event->getDataObject();
if ($store->getOrigData('is_active') != $store->getIsActive() && $store->getIsActive()) {
$event->getProcess()->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
}
}
} anyways it's just a matter of preference. |
wow man, good stuff! Added your code, tested and it's great! |
@elidrissidev totally agree, I was thinking about it, going to work on the v19->v20 PR asap |
@elidrissidev #2697 updated with everything |
EAV indexers now are indexing all datas also from storeviews that are disabled (manage by configuration field core_store.is_active), creating a lot of records in the
catalog_product_index_eav
andcatalog_product_index_eav_decimal
tables.This PR modifies the idexers in order to exclude disabled storeviews from the EAV indexing.
Fixed Issues
Manual testing scenarios (*)
php shell/indexer.php --reindex catalog_product_attribute
catalog_product_index_eav
andcatalog_product_index_eav_decimal
, you'll see that records related to the disabled storeviews are created (column store_id)php shell/indexer.php --reindex catalog_product_attribute
catalog_product_index_eav
andcatalog_product_index_eav_decimal
, you'll see that records related to the disabled storeviews are not created anymore