Force updating search index #2607
Replies: 1 comment
-
I ended up making a simple plugin which imports DefaultSearchPlugin and listens for OrderStateTransitionEvent's. When it detects a "PaymentSettled" event it will trigger a reindex using the injected SearchIndexService. Seems to work well enough for my scenario. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying to figure out a way to forcefully updating the search index, either by:
a) Updating it when a purchase/order has been placed
b) Every X minutes/hours
The reason is because I'm using the "inStock" parameter when searching - and that is not updated (of course) unless the product/variant/else... is changed/updated. Since it is not updating fast enough for me I am trying to figure out how to make it update faster.
Yes, I have concidered the downsides of rebuilding the search index - and I don't see a problem because the number of products in the store are so few I'm fine with it.
Any ideas are welcome. Right now my closest idea is making some kind of plugin that detects order state transitions and will then reindex... somehow.
Beta Was this translation helpful? Give feedback.
All reactions