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

Fix --network-wide flag in WP-CLI index command #2771

Merged
merged 5 commits into from
May 18, 2022
Merged

Conversation

felipeelia
Copy link
Member

Description of the Change

As stated in #2766, ElasticPress 4.x introduced a change in the index WP-CLI command that it would always index all sites, even when the --network-wide flag is not passed. This PR changes that back to the 3.x behavior:

In order to index all sites, the user needs to run wp elasticpres index ... --network-wide, otherwise only the main site will be indexed.

In addition to that, this PR also fixes all WP-CLI commands that rely on get_index_names() method, using indices names for all sites only when it is network activated. Commands affected are:

  • get-mapping
  • get-indexes
  • status
  • stats

Closes #2766

Changelog Entry

  • Fixed: WP-CLI index command without the --network-wide only syncs the main site.
  • Fixed: WP-CLI commands get-mapping, get-indexes, status, and stats only uses all sites' indices name when network activated.

Credits

Props @felipeelia @colegeissinger

@felipeelia felipeelia added this to the 4.2.0 milestone May 17, 2022
@felipeelia felipeelia self-assigned this May 17, 2022
Copy link
Contributor

@tott tott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@felipeelia felipeelia merged commit 3c201b4 into develop May 18, 2022
@felipeelia felipeelia deleted the fix/issue-2766 branch May 18, 2022 12:44
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.

BUG: Using --url when running index on a multisite not working. Getting full network index always.
2 participants