mirror of
https://github.com/ivabus/www
synced 2024-11-25 19:05:07 +03:00
#294 include maintainer in search
This commit is contained in:
parent
efcb66d69e
commit
d3e1a4066d
1 changed files with 2 additions and 2 deletions
|
@ -209,8 +209,8 @@
|
|||
|
||||
function getMatchScore(term, dataset) {
|
||||
// provide higher value with name
|
||||
const { name, description } = dataset;
|
||||
const exactMatch = name.toLocaleLowerCase().includes(term.toLocaleLowerCase());
|
||||
const { name, maintainer, description } = dataset;
|
||||
const exactMatch = [maintainer, name].join(" ").toLocaleLowerCase().includes(term.toLocaleLowerCase());
|
||||
const nameScore = stringSimilarity.compareTwoStrings(name, term);
|
||||
const descriptionScore = stringSimilarity.compareTwoStrings(description, term);
|
||||
return (nameScore*80) + (descriptionScore*20) + (exactMatch ? 100 : 0);
|
||||
|
|
Loading…
Reference in a new issue