wp-search-with-algolia icon indicating copy to clipboard operation
wp-search-with-algolia copied to clipboard

Fixes #442: Running WP_CLI command wp algolia reindex --all would clear index even if --clear flag is not specified

Open menno-ll opened this issue 1 year ago • 4 comments

Fixes #442

Fixes an issue where

  • The WP-CLI command without the --clear flag would call $index->re_index( 1 );
  • And $index->re_index( 1 ); would trigger the $index->create_index_if_not_existing() function
  • And $index->create_index_if_not_existing() would clear the index if the index already exists (which was specifically not chosen to do when calling the CLI command).

  • To see the specific tasks where the Asana app for GitHub is being used, see below:
    • https://app.asana.com/0/0/1208952565138971

menno-ll avatar Dec 11 '24 10:12 menno-ll

If you could please, undo the changes made for class-algolia-post-changes-watcher.php as that's something that WebDevStudios did a handful of releases back, and is intentional in that way. There's also not double clearing going on with that part of the codebase.

tw2113 avatar Dec 16 '24 13:12 tw2113

Reminder to myself later: we need to get this PR'd against a release branch and not main.

tw2113 avatar Dec 17 '24 13:12 tw2113

Changes in class-algolia-post-changes-watcher.php have been reverted.

menno-ll avatar Dec 19 '24 08:12 menno-ll

Thank you sir.

tw2113 avatar Dec 19 '24 13:12 tw2113