Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6408 +/- ##
==========================================
+ Coverage 69.33% 69.37% +0.04%
==========================================
Files 141 141
Lines 18794 18801 +7
Branches 3061 3063 +2
==========================================
+ Hits 13031 13044 +13
+ Misses 5118 5111 -7
- Partials 645 646 +1
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
PR make fuzzy plugin better when query shorter than field, so user can do substring-ish fuzzy search (help for noisy titles like YouTube). Also add changelog note for Unreleased.
Changes:
- Scale fuzzy threshold by max possible ratio when
len(pattern) < len(val). - Use
quick_ratio()as cheap gate beforeratio()calc. - Add changelog entry for fuzzy matching improvement.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/changelog.rst | Add Unreleased note for fuzzy plugin behavior change. |
| beetsplug/fuzzy.py | Adjust fuzzy matching logic to behave better for shorter queries. |
feece21 to
64d2a56
Compare
64d2a56 to
48763ee
Compare
This file contains hidden or 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
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.
Fixes #2043
Fixes #5638
Improve the
fuzzyplugin in two ways:Problem
Fuzzy prefix queries (for example
~fooor custom prefixes like%%foo) could take a fast DB query path on normal fields, which bypassed fuzzy semantics and produced broad/unrelated matches #5638.
Also, when the query pattern was shorter than the field value, fuzzy matching was too strict for substring-style use cases #2043.
Thanks to @carreter for this in #5140. Opened a new PR since I did not have permissions to push to their fork.
Supersedes #5140.