-
Notifications
You must be signed in to change notification settings - Fork 313
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 post tag duplication in ES query #2341
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oscarssanchez
changed the title
Fix/post tag duplication
Fix post tag duplication in ES query
Sep 14, 2021
Rahmon
reviewed
Sep 14, 2021
Rahmon
previously approved these changes
Sep 21, 2021
felipeelia
requested changes
Sep 22, 2021
…ss into fix/post-tag-duplication
felipeelia
requested changes
Sep 23, 2021
…ss into fix/post-tag-duplication
felipeelia
approved these changes
Sep 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This PR aims to fix three things. First, there's a duplication of
terms.post_tag.slug
similar to the problem that was happening in #2242 when you are making with similar args:This is fixed here: https://github.com/10up/ElasticPress/compare/fix/post-tag-duplication?expand=1#diff-7004c1b9f26ece8d68d4d3b7b822331a1f1e0cdf34a5eda1aa146d930d21ad08R1007 adding
post_tag
andcategory
as these are WP Core default taxonomies, and I have added the filter 'ep_post_tax_excluded_wp_query_root_check' in case this is needed to be extended by a developer.Second, doing a query for more than one term in an array form does not work, as it will format the
tag
arg like a comma separated string.Third, searching for multiple tags with comma separated tags does not work at all. This is allowed by core: https://developer.wordpress.org/reference/classes/wp_query/#tag-parameters
It looks like core will translate both the array and comma separated strings as comma separated, which is different than how it formats a tax query, therefore that part remains unaffected
Alternate Designs
Benefits
Expand
WP_Query
Possible Drawbacks
Verification Process
Checklist:
Applicable Issues
Changelog Entry