@@ -34,8 +34,9 @@ internal static List<Result> GetResultList(
34
34
var resultList = new List < Result > ( ) ;
35
35
foreach ( var entry in list )
36
36
{
37
- const int highScore = 20 ;
38
- const int midScore = 10 ;
37
+ // Adjust the score to lower the order of many irrelevant matches from area strings
38
+ // that may only be for description.
39
+ const int nonNameMatchScoreAdj = 10 ;
39
40
40
41
Result ? result ;
41
42
Debug . Assert ( _api != null , nameof ( _api ) + " != null" ) ;
@@ -44,7 +45,7 @@ internal static List<Result> GetResultList(
44
45
45
46
if ( nameMatch . IsSearchPrecisionScoreMet ( ) )
46
47
{
47
- var settingResult = NewSettingResult ( nameMatch . Score + highScore , entry . Type ) ;
48
+ var settingResult = NewSettingResult ( nameMatch . Score , entry . Type ) ;
48
49
settingResult . TitleHighlightData = nameMatch . MatchData ;
49
50
result = settingResult ;
50
51
}
@@ -53,15 +54,15 @@ internal static List<Result> GetResultList(
53
54
var areaMatch = _api . FuzzySearch ( query . Search , entry . Area ) ;
54
55
if ( areaMatch . IsSearchPrecisionScoreMet ( ) )
55
56
{
56
- var settingResult = NewSettingResult ( areaMatch . Score + midScore , entry . Type ) ;
57
+ var settingResult = NewSettingResult ( areaMatch . Score - nonNameMatchScoreAdj , entry . Type ) ;
57
58
result = settingResult ;
58
59
}
59
60
else
60
61
{
61
62
result = entry . AltNames ?
62
63
. Select ( altName => _api . FuzzySearch ( query . Search , altName ) )
63
64
. Where ( match => match . IsSearchPrecisionScoreMet ( ) )
64
- . Select ( altNameMatch => NewSettingResult ( altNameMatch . Score + midScore , entry . Type ) )
65
+ . Select ( altNameMatch => NewSettingResult ( altNameMatch . Score - nonNameMatchScoreAdj , entry . Type ) )
65
66
. FirstOrDefault ( ) ;
66
67
}
67
68
@@ -75,7 +76,7 @@ internal static List<Result> GetResultList(
75
76
. SelectMany ( x => x )
76
77
. Contains ( x , StringComparer . CurrentCultureIgnoreCase ) )
77
78
)
78
- result = NewSettingResult ( midScore , entry . Type ) ;
79
+ result = NewSettingResult ( nonNameMatchScoreAdj , entry . Type ) ;
79
80
}
80
81
}
81
82
@@ -115,7 +116,7 @@ private static string GetSubtitle(string section, string entryType)
115
116
private static void AddOptionalToolTip ( WindowsSetting entry , Result result )
116
117
{
117
118
var toolTipText = new StringBuilder ( ) ;
118
-
119
+
119
120
var settingType = entry . Type == "AppSettingsApp" ? "System settings" : "Control Panel" ;
120
121
121
122
toolTipText . AppendLine ( $ "{ Resources . Application } : { settingType } ") ;
0 commit comments