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

Failed Queries: Different message if no index is found #3436

Merged
merged 9 commits into from
May 19, 2023

Conversation

felipeelia
Copy link
Member

Description of the Change

If the Elasticsearch server does not have any index related to the current WordPress installation, the "Failed queries" message will be different, pointing the user to sync.

This PR also adds a new method called get_indices_comparison() to the Elasticsearch class. It returns an array of two arrays: a list of present indices, and a list of missing ones.

How to test the Change

  1. Enable more than one Indexable (Comments or Terms, for example)
  2. Sync
  3. Delete one index
  4. See the old message
  5. Delete all indices
  6. See the new message

Changelog Entry

Changed - If no index is found, the failed queries message will be replaced with a prompt to sync

Credits

Props @felipeelia

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@felipeelia felipeelia added this to the 5.0.0 milestone Apr 6, 2023
@felipeelia felipeelia added needs discussion module:sync Issues related to the Sync functionality labels Apr 6, 2023
includes/classes/QueryLogger.php Outdated Show resolved Hide resolved
includes/classes/QueryLogger.php Show resolved Hide resolved
Co-authored-by: Oscar Sanchez <oscarssanchez@users.noreply.github.com>
@oscarssanchez oscarssanchez self-requested a review April 26, 2023 20:08
@felipeelia felipeelia modified the milestones: 5.0.0, 4.6.0 Apr 26, 2023
@felipeelia felipeelia merged commit 0482ee7 into develop May 19, 2023
@felipeelia felipeelia deleted the feature/indices-comparison branch May 19, 2023 17:28
@felipeelia felipeelia mentioned this pull request May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:sync Issues related to the Sync functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants