aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cards/mypage/text.md1
-rw-r--r--scripts/make-search-index.js7
2 files changed, 6 insertions, 2 deletions
diff --git a/cards/mypage/text.md b/cards/mypage/text.md
index e352751..5789043 100644
--- a/cards/mypage/text.md
+++ b/cards/mypage/text.md
@@ -6,6 +6,7 @@ redirects:
- old:mypage
tags:
- about/test
+ - something/thencefence
---
# My Testing Page
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)
})