Skip to content

Commit 7eb8db7

Browse files
committed
fix: Cannot load unregistered function: stemmer-ru
fixes #8830
1 parent 34f4e5b commit 7eb8db7

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

samples/seed/template/public/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export default {
1313
title: 'Twitter'
1414
}
1515
],
16+
lunrLanguages: ['en', 'ru'],
1617
configureHljs: function (hljs) {
1718
hljs.registerLanguage('bicep', bicep);
1819
},
1920
}
21+

templates/modern/src/search-worker.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ async function loadIndexCore() {
2626
const data = await res.json() as { [key: string]: SearchHit }
2727
const cache = createStore('docfx', 'lunr')
2828

29-
if (etag) {
30-
const value = JSON.parse(await get('index', cache) || '{}')
31-
if (value && value.etag === etag) {
32-
return { index: lunr.Index.load(value), data }
33-
}
34-
}
35-
3629
const { lunrLanguages, configureLunr } = await import('./main.js').then(m => m.default) as DocfxOptions
3730

3831
if (lunrLanguages && lunrLanguages.length > 0) {
@@ -41,6 +34,13 @@ async function loadIndexCore() {
4134
await Promise.all(lunrLanguages.map(initLanguage))
4235
}
4336

37+
if (etag) {
38+
const value = JSON.parse(await get('index', cache) || '{}')
39+
if (value && value.etag === etag) {
40+
return { index: lunr.Index.load(value), data }
41+
}
42+
}
43+
4444
const index = lunr(function() {
4545
lunr.tokenizer.separator = /[\s\-.()]+/
4646

0 commit comments

Comments
 (0)