algoliasearch-wordpress
algoliasearch-wordpress copied to clipboard
Rate Limiting Index Operations
Is there a way to rate limit index operations? My site is using 100s of thousands of indexing operations. Which seems excessive. Is there a way to limit the number of indexing operations or choose how often a post is indexed?
Iβm assuming posts are reindexed every time they are updated. But in this case I have thousands of posts (type product) being updated every day. But they donβt need to be reindexed each time.
I love this plugin/product but Iβll have to stop using it if I have to keep paying for unnecessary indexing operations.
Hello @pleek91 ,
Could you tell me a bit more about was is qualified as "unnecessary" indexing operations? The plugin does its best at keeping your data in sync with Algolia. That is what most users expect by default.
You can disable auto synchronization and re-index manually whenever you see fit: https://community.algolia.com/wordpress/indexing-flow.html#queue-processing
You can also leverage the wp-cli command and run a cron on that every week or month: https://community.algolia.com/wordpress/wp-cli.html
Let me know if that helps,
@rayrutjes
Thanks for your response. They're unnecessary operations for my project as the piece of data I'm updating doesn't affect my search results. So I'm using up thousands of indexing operations with little benefit to my application.
I agree keeping the data in sync is the expected behavior, no complaints there. But since my site updates thousands of posts each day its getting out of control lol.
I thought of rate limiting as a way to only do x number of index operations per day/hour/etc. But the documentation you linked to might be the solution.
Thanks!
So I've been messing around with those hooks and monitoring the algolia operation logs/graphs to see how each one affects the # of operations.
One thing I don't understand is every day I have thousands of delete operations. Even though no posts are being deleted. Which is weird.
Couple of questions.
- What is the difference between the
algolia_should_index_searchable_post
and thealgolia_should_index_post
hooks? The docs doesn't really explain. - What are the watchers that
algolia_changes_watchers
filters? The docs also doesn't provide a list, just an explanation of the types. - Is there a hook that determines if a post should be synced at the time of sync? So if a post is saved, is there a hook that decides if the post should be synced? That would be useful for anyone doing mass updates (like I am) to exclude that mass updates from being synced but allow any user updates to be synced.