Skip to content

Commit 77519b3

Browse files
committed
improve multi-word search
1 parent 067454b commit 77519b3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/components/syntaxes/SyntaxDisplayManager.astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,14 @@ export interface VersionFilterData {
327327
score += 25;
328328
}
329329

330+
// if multiple words, add score from each word / 10
331+
let words = searchLower.split(" ");
332+
if (score == 0 && words.length > 1) {
333+
words.forEach(word => {
334+
score += scoreSearchMatch(item, word) / 10
335+
})
336+
}
337+
330338
return score;
331339
}
332340

0 commit comments

Comments
 (0)