algoliasearch-wordpress icon indicating copy to clipboard operation
algoliasearch-wordpress copied to clipboard

Rate Limiting Index Operations

Open pleek91 opened this issue 6 years ago β€’ 3 comments

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.

pleek91 avatar May 08 '18 17:05 pleek91

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 avatar May 09 '18 06:05 rayrutjes

@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!

pleek91 avatar May 09 '18 14:05 pleek91

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.

  1. What is the difference between the algolia_should_index_searchable_post and the algolia_should_index_post hooks? The docs doesn't really explain.
  2. What are the watchers that algolia_changes_watchers filters? The docs also doesn't provide a list, just an explanation of the types.
  3. 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.

pleek91 avatar May 15 '18 14:05 pleek91