File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
src/lib/output/themes/default/assets/typedoc/components Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 2828 "external" : false ,
2929 "@internal" : false
3030 },
31+ "searchGroupBoosts" : {
32+ "Classes" : 2.0 ,
33+ "Interfaces" : 2.0 ,
34+ "Enumerations" : 2.0 ,
35+ "Type Aliases" : 2.0
36+ },
37+ "searchInComments" : true ,
3138 "logLevel" : " Verbose"
3239}
Original file line number Diff line number Diff line change 11# Unreleased
22
3+ ### Features
4+
5+ - The ` DEBUG_SEARCH_WEIGHTS ` global variable can now be set on ` window ` to add search scoring information in the search results.
6+
37## v0.23.4 (2022-07-02)
48
59### Bug Fixes
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ function updateResults(
169169 // boost by exact match on name
170170 if ( row . name . toLowerCase ( ) . startsWith ( searchText . toLowerCase ( ) ) ) {
171171 boost *=
172- 1 + 1 / ( Math . abs ( row . name . length - searchText . length ) * 10 ) ;
172+ 1 + 1 / ( 1 + Math . abs ( row . name . length - searchText . length ) ) ;
173173 }
174174
175175 item . score *= boost ;
@@ -182,6 +182,9 @@ function updateResults(
182182
183183 // Bold the matched part of the query in the search results
184184 let name = boldMatches ( row . name , searchText ) ;
185+ if ( globalThis . DEBUG_SEARCH_WEIGHTS ) {
186+ name += ` (score: ${ res [ i ] . score . toFixed ( 2 ) } )` ;
187+ }
185188 if ( row . parent ) {
186189 name = `<span class="parent">${ boldMatches (
187190 row . parent ,
You can’t perform that action at this time.
0 commit comments