aboutsummaryrefslogtreecommitdiff
path: root/scripts/make-search-index.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/make-search-index.js')
-rw-r--r--scripts/make-search-index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/make-search-index.js b/scripts/make-search-index.js
index f923b54..38ed214 100644
--- a/scripts/make-search-index.js
+++ b/scripts/make-search-index.js
@@ -34,7 +34,7 @@ lunr = require("lunr")
fs = require("fs")
if(process.argv.length !== 5) {
- console.error('Needs exactly 3 arguments (input json, output index).');
+ console.error('Needs exactly 3 arguments (input json, output index, output metadata).');
process.exit(1);
}
@@ -44,7 +44,7 @@ lunr.tokenizer.separator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u
var idx = lunr(function () {
this.ref('link')
- this.field('title', {boost: 9})
+ this.field('name', {boost: 9})
this.field('tag', {boost: 3})
this.field('text')
@@ -56,5 +56,5 @@ var idx = lunr(function () {
fs.writeFileSync(process.argv[3], JSON.stringify(idx), {encoding: 'utf8'})
fs.writeFileSync(process.argv[4], JSON.stringify(
- Object.fromEntries(documents.map(x => [x.link, {"title": x.title, "tags": x.tags}]))
+ Object.fromEntries(documents.map(x => [x.link, {"name": x.name, "tags": x.tags}]))
), {encoding: 'utf8'})