Skip to content

Commit

Permalink
Updated Flutter icon weights for SDK search hits.
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Dec 21, 2023
1 parent 21837fa commit 5d31e43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/lib/search/flutter_sdk_mem_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const _allowedLibraries = <String>{
};

const _flutterApiPageDirWeights = <String, double>{
'cupertino/CupertinoIcons': 0.7,
'material/Icons': 0.7,
'cupertino/CupertinoIcons': 0.25,
'material/Icons': 0.25,
};

final _logger = Logger('search.flutter_sdk_mem_index');
Expand Down
5 changes: 4 additions & 1 deletion app/lib/search/sdk_mem_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ class SdkMemIndex {
},
);

hits.add(_Hit(library, weightedResults));
final hit = _Hit(library, weightedResults);
if (hit.score > 0.25) {
hits.add(hit);
}
}
if (hits.isEmpty) return <SdkLibraryHit>[];

Expand Down

0 comments on commit 5d31e43

Please sign in to comment.