Partial updates in Magento

Hi,

we had partial updates enabled in magento. But this seems to miss the situation where an attribute is removed.
Example: Product has msrp of 5, then someone removes the msrp altogether and saves the product. This is uploaded to algolia without msrp, but because of partial updates the msrp stays in the index.
We solved this by switching partial updates off, but I guess this behaviour is not intentional.

regards
Alex
m1.9/algolia 1.14.1

Hello Alex (@alex1),

this is expected and this is a known downside of a partial update - it updates only attributes you sent and the extension or Algolia don’t know which attributes you want to remove.

Possible workaround would be to send a null attribute for msrp now.

Did you remove msrp completely from attributes to index?

Hi,
understood. Not sure if partial updates is a real use case for ecommerce/magento then, except if you only switch it on temporarily, e.g. to do a mass update of just prices or so.
You could work out which ones to remove if you hook during save before the DB update, and compare DB/old values of product with new values. I guess that’s painfull.

We are still indexing msrp, it was really just someone removing msrp from a single product.

I can easily live without partial updates, though.

regards
Alex

1 Like

Thank you for the update and sorry for the late reply. I understand your use-case better now and I guess partial updates are not a good solution here.

But I don’t really agree with this:

We have users who index their data from Magento, but then enrich it with another data from 3rd party applications, like ERPs, analytics tools, etc… So in a use-case, when you don’t have all the data at the same place, partial updates come in handy, because you can push data to the same record from multiple places.

Thanks Jan.
Understood your intended use case, but IMO this is still quite dangerous: If you have an update coming from a third party that would set something to null, this is not forwarded to algolia. So I guess that should only be triggered programmatically, when the developer is absolutely sure he only wants to add data.

Exactly! That’s why you need to enable it explicitly in Advanced configuration of the Algolia extension.

Otherwise the extension will always use “regular” updates.