Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomez
rustdoc: search result ranking fix # Before  # After 
This commit is contained in:
commit
d34915f691
4 changed files with 36 additions and 1 deletions
|
|
@ -1323,7 +1323,6 @@ window.initSearch = rawSearchIndex => {
|
|||
}
|
||||
}
|
||||
lev = levenshtein(searchWord, elem.pathLast);
|
||||
lev += lev_add;
|
||||
if (lev > 0 && elem.pathLast.length > 2 && searchWord.indexOf(elem.pathLast) > -1)
|
||||
{
|
||||
if (elem.pathLast.length < 6) {
|
||||
|
|
@ -1332,6 +1331,7 @@ window.initSearch = rawSearchIndex => {
|
|||
lev = 0;
|
||||
}
|
||||
}
|
||||
lev += lev_add;
|
||||
if (lev > MAX_LEV_DISTANCE) {
|
||||
return;
|
||||
} else if (index !== -1 && elem.fullPath.length < 2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue