add fuzzy search score for ordering

This commit is contained in:
Jeremy Wu 2020-12-14 19:14:50 +11:00
parent 5d7102eadb
commit 8a86bf7496

View file

@ -83,7 +83,14 @@ namespace Flow.Launcher.Plugin.PluginsManager
return results;
return results
.Where(x => StringMatcher.FuzzySearch(searchName, x.Title).IsSearchPrecisionScoreMet())
.Where(x =>
{
var matchResult = StringMatcher.FuzzySearch(searchName, x.Title);
if (matchResult.IsSearchPrecisionScoreMet())
x.Score = matchResult.Score;
return matchResult.IsSearchPrecisionScoreMet();
})
.ToList();
}