Bypass SearchPrecisionScore and related tests

This commit is contained in:
pc223 2021-07-29 10:08:58 +07:00
parent 68811fa324
commit d0467c6f14
2 changed files with 13 additions and 12 deletions

View file

@ -65,8 +65,8 @@ namespace Flow.Launcher.Plugin.SharedModels
public enum SearchPrecisionScore
{
Regular = 0,
Low = 0,
Regular = 50,
Low = 20,
None = 0
}
}

View file

@ -83,16 +83,16 @@ namespace Flow.Launcher.Plugin.Program.Programs
else matchResult = nameMatch;
}
if (!matchResult.IsSearchPrecisionScoreMet())
{
if (ExecutableName != null) // only lnk program will need this one
matchResult = StringMatcher.FuzzySearch(query, ExecutableName);
if (!matchResult.IsSearchPrecisionScoreMet())
return null;
matchResult.MatchData = new List<int>();
}
// if (!matchResult.IsSearchPrecisionScoreMet())
// {
// if (ExecutableName != null) // only lnk program will need this one
// matchResult = StringMatcher.FuzzySearch(query, ExecutableName);
//
// if (!matchResult.IsSearchPrecisionScoreMet())
// return null;
//
// matchResult.MatchData = new List<int>();
// }
@ -104,6 +104,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
var oldScore = matchResult.RawScore;
matchResult.RawScore = Math.Max(newScore, oldScore);
matchResult.RawScore *= 10; // Bypass the SearchPrecisionScore and related tests
matchResult.MatchData = new List<int>();