Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to avoid search index updates #1416

Closed
mediabeastnz opened this issue Apr 30, 2020 · 4 comments
Closed

Add ability to avoid search index updates #1416

mediabeastnz opened this issue Apr 30, 2020 · 4 comments
Labels
💡 enhancement Ideas and suggestions 🧾 orders

Comments

@mediabeastnz
Copy link
Contributor

Description

In larger sites e.g. 1000's of products and carts the queue is constantly filled up with search index updates as Commerce uses Crafts saveElement function which updates the search index each time.

It would be great if some how this could be disabled.

I wasn't sure if this is the right place to post as I know the culprit here is the Craft saveElement function.

@lukeholder lukeholder added 💡 enhancement Ideas and suggestions 🧾 orders labels May 4, 2020
@lukeholder lukeholder changed the title [Feature Request] Add ability to avoid search index updates Add ability to avoid search index updates May 4, 2020
@lukeholder
Copy link
Member

Do you have your queue running automatically, or only when someone hits the CP?

Since emails are on the queue now most people set https://docs.craftcms.com/v3/config/config-settings.html#runqueueautomatically to false and have their own always-running daemon, or a cron job to run the queue. This should reduce the number of jobs you see in the queue (if that's what the customer is having an issue with?).

@mediabeastnz
Copy link
Contributor Author

The "issue" is Commerce (because of Craft) saves the order/cart everytime a small update is made. E.g. qty updates, new lineitem, new cart etc etc. This is obviously required but I don't really see why the searchIndex needs to be updated for carts.

It's almost like the Orders/Carts need their own save function rather than piggy backing of SaveElement()

@lukeholder
Copy link
Member

Fixed for the next release, you can now use the config option:

updateCartSearchIndexes

Determines whether the search index should be updated when a cart is saved by a customer when they use the commerce/cart/* controller actions.
Making this false will reduce the number of search index update jobs created, but will also reduce the ability to search carts in the control panel.

Default true

@mediabeastnz
Copy link
Contributor Author

Thanks @lukeholder 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 enhancement Ideas and suggestions 🧾 orders
Projects
None yet
Development

No branches or pull requests

2 participants