You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Atm we are running into a set-up specific challenge regarding updating the search index. We have created a plugin that will receive stock updates from a third party. We would like to update the search index accordingly. This could be achieved by dispatching a ProductVariantEvent if the stock update is received, which would be correct but also pretty broad. Because a different feature of the same plugin listens to the ProductVariantEvent as well to update product information in the third party system. So we would create a loop if we didn't do any additional checks.
Describe the solution you'd like
We reasoned that it would be nice to be able to update the search index upon the StockMovementEvent event also. It would be nice if this would be added to the plugin core or to be made configurable in the plugin. For the latter I am referring to a way of configuring (additional) events that should update the search index.
The text was updated successfully, but these errors were encountered:
Perhaps an elegant way of supporting this without needing to introduce any new config or APIs would be to simply export the internal SearchIndexService, which has methods like reindex() and updateVariants() which, when called, will send jobs to the queue for processing.
In this way, you could inject the service into your own plugin and call it from an eventbus subscriber function.
All right. Thanks. We will look into your proposed way of supporting this. Do you see that as equally "correct" from a design point of view? Or would you switch to an event based solution when supported? Because it feels like tighter coupling between plugins.
I think the event-based approach does indeed have the edge due to the looser coupling. I'll have a think about a good API for this for the next update to this plugin. Feel free to contribute any ideas for the kind of API you'd like to see.
Is your feature request related to a problem? Please describe.
Atm we are running into a set-up specific challenge regarding updating the search index. We have created a plugin that will receive stock updates from a third party. We would like to update the search index accordingly. This could be achieved by dispatching a ProductVariantEvent if the stock update is received, which would be correct but also pretty broad. Because a different feature of the same plugin listens to the ProductVariantEvent as well to update product information in the third party system. So we would create a loop if we didn't do any additional checks.
Describe the solution you'd like
We reasoned that it would be nice to be able to update the search index upon the StockMovementEvent event also. It would be nice if this would be added to the plugin core or to be made configurable in the plugin. For the latter I am referring to a way of configuring (additional) events that should update the search index.
The text was updated successfully, but these errors were encountered: