Terms: Adjust fuzziness for admin term search queries #2417
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 fixes a bug when searching in the admin for post tags and the results are unexpected. To reproduce:
wp elasticpress activate-feature terms
wp elasticpress index --setup
It doesn't make sense to have fuzzy search enabled for terms in the back-end, especially since users are most likely to be searching for a specific word in the tags..
Alternate Designs
We could change the default to be 0 instead of 1 but I'm not sure how far reaching that would be for non-admin term queries:
ElasticPress/includes/classes/Indexable/Term/Term.php
Line 387 in a1c02b2
Benefits
Results will be more accurate when searching for a tag with a term in it.
Possible Drawbacks
For users who appreciate the fuzziness, they may be wondering why it is no longer there.
Verification Process
Checklist:
Changelog Entry
Changed: Terms search query in admin will not be fuzzy