5

I'm using Magento ee 1.13.0.2 and discovering the next problem:
I have some of the attributes used in layered navigation - color and size. When I add a new product (simple one) and save it - product successfully appears in catalog, however if I click on product's size/color in layered nav - product is not found. If I go to index management page, I see "Product attributes" has mode "Update on Save" and status "Reindex required". If I reindex manually - everything works fine, product can be found by color/size now.

But this is not something I expect - if there is "Update on Save", index should be updated automatically on product save, without manual reindex, right?

Future tests shows me, that Product attribute index becomes "Reindex Required" always, when I save product even without changes..

I tried to debug reindex on product save, and it appears that queries, which fill catalog_product_index_eav, catalog_product_index_eav_tmp tables are all part of one big transaction, which starts on "product save before" and ends on "product save after". Of course, when I debug queries which are generating data for index_eav tables, they return empty results, because product doesn't even exists in catalog_product_entity table...

So, for now I stuck on this, had any one the same issue?

  • we are having exactly the same issue in 1.13.0.2. This not only happens when we add a new product, but when we update an existing product (let's say we update it's price) The "Product Attributes" index asks for "Reindex Required" Any help will be appretiated – user4723 Jan 15 '14 at 19:05
  • We are having the same issue and have traced the invalidating back to the event cataloginventory_stock_partial_reindex but even removing this event will mean that the data has not been indexed. – David Manners Jan 20 '14 at 16:08
  • So useful information about indexing in ee113 at magentocommerce.com/knowledge-base/entry/ee113-indexing – David Manners Jan 20 '14 at 16:41
2

The problem is that partial reindex was not implemented for product attributes and tags indices.

It is still persistent in 1.14.0.1. You may find more details in my question here. Also some comments are also quite interesting.

1

The only way I could solve this was:

$product
    ->setForceReindexRequired(true)
    ->setIsChangedCategories(true);

    Mage::getSingleton('index/indexer')->processEntityAction(
                    $product,
                    Mage_Catalog_Model_Product::ENTITY,
                    Mage_Index_Model_Event::TYPE_SAVE
                );

    $process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_attribute');
                $process->reindexEverything();

I know isn't the best, but is the only that works for me.

  • 4
    It would be useful to know where have you added this code. – user487772 Jul 19 '14 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.