aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2023-07-16 19:33:07 +0200
committerMirek Kratochvil <exa.exa@gmail.com>2023-07-16 19:33:07 +0200
commit0749bee908eee97dcd40df9e0dd841d77ed43a91 (patch)
tree262a8bd0d39b63d2c751d0bb1a839c69ba044c43 /scripts
parent00d1e456828bc150290435f693b985f044598ec5 (diff)
downloadreploy-0749bee908eee97dcd40df9e0dd841d77ed43a91.tar.gz
reploy-0749bee908eee97dcd40df9e0dd841d77ed43a91.tar.bz2
include tags in search
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make-search-index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/make-search-index.js b/scripts/make-search-index.js
index 37c5ce5..635804b 100644
--- a/scripts/make-search-index.js
+++ b/scripts/make-search-index.js
@@ -26,10 +26,13 @@ documents = JSON.parse(fs.readFileSync(process.argv[2], {encoding: 'utf8'}))
var idx = lunr(function () {
this.ref('link')
- this.field('title', {boost: 10})
+ this.field('title', {boost: 9})
+ this.field('tag', {boost: 3})
this.field('text')
+
documents.forEach(function (doc) {
- this.add(doc)
+ const {link, title, text, tags} = doc;
+ this.add({link, title, text, tag:tags.map(x => x.join(" ")).join("\n")})
}, this)
})