Smile-SA / smile-magento-elasticsearch

Magento ElasticSearch Implementation
151 stars 90 forks source link

QUESTION: Is it possible with the ElasticSearch module to do partial reindexing ? #65

Closed sylvainraye closed 7 years ago

sylvainraye commented 8 years ago

Hi,

We have Magento 1.14 EE and it looks like that each time it needs a full reindex of the Elastic Search index. Is there any way to do a partial reindexing ?

romainruaud commented 8 years ago

Hello,

could you please develop what is exactly happening ? The module supports partial reindexing (Mview or not).

Best regards,

sylvainraye commented 8 years ago

Hi,

Thank you for your feedback.

Magento EE does a reindexing via cron job and update product price, category and so on ONLY for updated data or entities. Not for the full catalog. That's the purpose of a partial reindexing. Preventing to reindex all as it's time consuming.

The ElasticSearch Module use the catalogsearch mview metadata to reindex. The reindexing works as the following:

From my point of view, it doesn't respect the philosophy of partial reindexing to reindex only what is needed to be reindexed in the purpose to save time. It reindex all

Best regards Sylvain

romainruaud commented 8 years ago

Hello Sylvain and thank you for this detailed explanation of the issue.

I will take a look at it, try to reproduce this behavior and then provide a fix. If this behavior is confirmed, you are right, this should not process this way and rebuild index for the whole catalog, but only reindex products that are in the changelog queue.

Regards,

romainruaud commented 8 years ago

Hello Sylvain,

unfortunately, I am not able to reproduce your issue, neither on this master branch, nor on our internal 1.4 (next release) branch.

This basic test case is ok :

In which cases could Magento process a full reindex by the cron ? If you look on Enterprise_Index_Model_Observer::refreshIndex() you will see that this cron process a full reindex for thoses considered as "inactive" : they are wrongly called "inactive" because in fact they are indexers that have an "INVALID" status (you can look at Enterprise_Index_Model_Observer::_getInactiveIndexersByPriority() ).

=> If something has invalidated the catalogsearch_fulltext index, Magento will process a full reindex on the next cronjob.

This may be what is happening to you. Could you check if something is invalidating your index ?

Regards,

sylvainraye commented 8 years ago

Hi

Do not close this issue and let me some time to give you more details

Thanks

romainruaud commented 7 years ago

Sorry but I close this one due to being inactive for too long.

Feel free to reopen if you have any additional comments.