Skip to content

Commit 01f3954

Browse files
author
Gaël Reyrol
committed
Add keywords to GUI search index -> rlidwka#312
1 parent af54e6f commit 01f3954

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/search.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ function Search() {
77
this.field('description' , { boost: 4 })
88
this.field('author' , { boost: 6 })
99
this.field('readme')
10+
this.field('keywords' , { boost: 8 })
11+
1012
})
1113
return self
1214
}
@@ -21,8 +23,9 @@ Search.prototype.add = function(package) {
2123
name: package.name,
2224
description: package.description,
2325
author: package._npmUser ? package._npmUser.name : '???',
26+
keywords: (package.keywords || []).join(' '),
2427
})
25-
},
28+
}
2629

2730
Search.prototype.remove = function(name) {
2831
this.index.remove({ id: name })

0 commit comments

Comments
 (0)