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

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

menno-ll
Copy link

@menno-ll menno-ll commented Dec 11, 2024

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).

@tw2113
Copy link
Member

tw2113 commented Dec 16, 2024

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
Copy link
Member

tw2113 commented Dec 17, 2024

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

@menno-ll
Copy link
Author

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

@tw2113
Copy link
Member

tw2113 commented Dec 19, 2024

Thank you sir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running WP_CLI command wp algolia reindex --all would clear index even if --clear flag is not specified
2 participants