Support » Plugin: WP Search with Algolia » What are the best options when it comes to triggering a reindex via cron job?

  • I know this plugin supports wp-cli for this type of functionality (per: https://community.algolia.com/wordpress/wp-cli.html)

    However, I’m dealing with a hosting provider where this isn’t a viable option. What other option(s) are there for handling this?

    I searched around and only found the WP-CLI option, but surely there should be an alternative available since WP-CLI isn’t always available/reliable. Also, if one doesn’t exist, would the best approach be to re-implement the ajax reindex operation to be handled via a functions.php function, or what would be the recommended approach be?

    The reason I ask this is that I have automatic sync disabled (see: https://community.algolia.com/wordpress/indexing-flow.html#queue-processing) for a specific site, and I want it to still sync up every week or so via a scheduled re-index.

    Currently, WP-CLI seems like the only way to trigger a re-index via cron from what I can tell, and their hosting isn’t reliable when it comes to utilizing that. As such, I’d like to see if there’s something that could be done without relying on WP-CLI to trigger a re-index via cron.

    Btw, this was migrated over from it having been unaddressed at https://wordpress.org/support/topic/what-are-the-best-options-when-it-comes-to-triggering-a-reindex-via-cron-job/, but I figured it could be mentioned here since it’s still something worth addressing.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Honestly looks like cron support and scheduling would be a feature request needing to be scoped out and developed as part of a future release at the moment.

    I don’t see why one couldn’t utilize the already existing AJAX code to handle, though it’d be good to keep in mind that it may not have an “all” action built yet.

    Regarding WP-CLI, I am curious about what degree of support you’re referring to. Do you mean not all have it pre-installed, for example? Or do some disable the ability to manually install it yourself, while they still offer you the ability to SSH into the server for you account? I know I’ve downloaded the wp-cli.phar file manually for some cases and just did something like php wp-cli.phar --version for a quick example that allowed me to still use it, though perhaps more verbosely.

    @tw2113 Understood regarding the need to plan & then develop the cron triggering & execution (without needing WP-CLI to do so) functionality.

    I have WP-CLI support on my own hosting, but I’m aware that some hosting providers don’t give SSH access so WP-CLI is then not available to them while they might have cronjob management in the hosting panel (meaning triggering re-index via a script then isn’t possible since they’d need WP-CLI to handle the re-indexing part, currently.) So this could help these people.

    In my specific case, I’m looking to schedule re-indexing of a site which then has SiteOrigin Page Builder being used on it. The issue discussed at https://github.com/WebDevStudios/wp-search-with-algolia/issues/9 means I can’t use WP-CLI without issue… and so I’m left unable to have a scheduled re-indexing of the site since I can’t use WP-CLI (even though I have it installed), and that’s the only means of triggering a site re-index, currently. So this would help me directly if this is sooner to be implemented than the fix for the WP-CLI indexing issue with SiteOrigin Page Builder.

    As an aside, I’ve posted this as a feature request at https://github.com/WebDevStudios/wp-search-with-algolia/issues/10 for greater visibility, discussions, etc.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.