-
-
Notifications
You must be signed in to change notification settings - Fork 320
[cmdpalette] fix scoring of space-separated search terms #2646
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
Conversation
|
Thank you very much |
saulpw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this, @midichef !
|
Hi @midichef what should I do if I want to use it? Do I must install the develop version running Thak you to you, @saulpw and @anjakefala |
Previously only the score for the final search term was used.
09567e1 to
264387d
Compare
|
I pushed a new commit that didn't change any code, only the description, to insert a |
|
@aborruso yes, once the PR is accepted into the
|
|
@aborruso |
|
Thank you @midichef a stupid question: is it better first to uninstall the version I have and then install the new? |
|
I uninstall first. But I don't actually know if that is better. |
|
@midichef wow, it works. I had noticed this for a very long time. I had never written it down, because it seemed strange to me that no one had ever noticed it, and then I thought there must be some reason why it must be malfunctioning :) Thank you again |
|
Thanks for your patience @aborruso! I was away for the holidays. =) It is now merged into develop. You can do |
|
Thank you very much @anjakefala |

Fixes part of #2645.
When multiple search terms are used in
fuzzymatch(), not all the terms are used for a match. Only the last matching term is used to score each part of the match. That is, forlongname, only the last matching term's score is used, and fordescription, only the last matching term's score is used.To see this, hit
Space, then typeselect a.select-aftershould be the top result, but it's not shown at all. (The proper rankings should look more like what you see searching forselectawith no space.)That's because
select-afteris incorrectly scored as a match foraonly, not as a match forselectand a match fora. So it is incorrectly pushed way down the ranking. That leavesselect-error-colas the top result, because it does not have any match foradragging it down. It gets the highest score by matching solely forselectand not fora.This PR lets each term contribute to a combined score. With it,
select aproperly ranksselect-afterandselect-around-nas the top two results. (There are remaining differences in the rankings withselectavsselect a, because theselect asearch adds a bonus to results wheredescriptionhasaat the start of a word instead of just in the middle.)