cchanged variable name

This commit is contained in:
Kim, Jimin 2021-09-08 11:31:19 +09:00
parent 0ee2cd0b13
commit b2449b589c

View file

@ -93,7 +93,7 @@ const map: Map = {
unsearchable: {}, unsearchable: {},
} }
const seriesMap: SeriesMap = {} const seriesMap: SeriesMap = {}
const index = elasticlunr(function () { const elasticlunrIndex = elasticlunr(function () {
this.addField("title" as never) this.addField("title" as never)
this.addField("body" as never) this.addField("body" as never)
this.setRef("url" as never) this.setRef("url" as never)
@ -286,7 +286,7 @@ function recursiveParse(
} }
map.posts[urlPath] = postData map.posts[urlPath] = postData
index.addDoc({ elasticlunrIndex.addDoc({
title: markdownData.title, title: markdownData.title,
body: markdownData.content, body: markdownData.content,
url: urlPath, url: urlPath,
@ -312,7 +312,7 @@ function recursiveParse(
title: markdownData.title, title: markdownData.title,
} }
index.addDoc({ elasticlunrIndex.addDoc({
title: markdownData.title, title: markdownData.title,
body: markdownData.content, body: markdownData.content,
url: urlPath, url: urlPath,
@ -394,7 +394,7 @@ function recursiveParse(
map.series[urlPath] = { ...postData, order: [], length: 0 } map.series[urlPath] = { ...postData, order: [], length: 0 }
} else { } else {
map.posts[urlPath] = postData map.posts[urlPath] = postData
index.addDoc({ elasticlunrIndex.addDoc({
title: markdownData.title, title: markdownData.title,
body: markdownData.content, body: markdownData.content,
url: urlPath, url: urlPath,
@ -502,4 +502,4 @@ for (const seriesURL in seriesMap) {
} }
fs.writeFileSync(mapFilePath, JSON.stringify(map)) fs.writeFileSync(mapFilePath, JSON.stringify(map))
fs.writeFileSync(outPath + "/search.json", JSON.stringify(index)) fs.writeFileSync(outPath + "/search.json", JSON.stringify(elasticlunrIndex))