From d0467c6f14c83ca9f0d5e0d3735b5228ead09290 Mon Sep 17 00:00:00 2001 From: pc223 <10551242+pc223@users.noreply.github.com> Date: Thu, 29 Jul 2021 10:08:58 +0700 Subject: [PATCH] Bypass SearchPrecisionScore and related tests --- .../SharedModels/MatchResult.cs | 4 ++-- .../Programs/Win32.cs | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedModels/MatchResult.cs b/Flow.Launcher.Plugin/SharedModels/MatchResult.cs index 61b30b06c..5144eb61d 100644 --- a/Flow.Launcher.Plugin/SharedModels/MatchResult.cs +++ b/Flow.Launcher.Plugin/SharedModels/MatchResult.cs @@ -65,8 +65,8 @@ namespace Flow.Launcher.Plugin.SharedModels public enum SearchPrecisionScore { - Regular = 0, - Low = 0, + Regular = 50, + Low = 20, None = 0 } } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 8dff079e7..bd05240d4 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -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(); - } + // 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(); + // } @@ -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();