docusaurus-search-local
docusaurus-search-local copied to clipboard
Nothing appears, no debug logs, no search index file or errors
Added the following section to the docusaurus config file:
themes: [
[
'@easyops-cn/docusaurus-search-local',
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
({
hashed: true,
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true
})
]
]
I cannot get the search to appear, even when running npm run serve after a build. I get no debug logs, no output and no errors. Haven't been able to work out what's happening here.
Any ideas?
"@docusaurus/core": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.3",
"@easyops-cn/docusaurus-search-local": "^0.36.0",
Same issue here, did you figure it out?
Same solution for me: https://github.com/easyops-cn/docusaurus-search-local/issues/206
In my case, it was the noIndex: true setting in docusaurus.config.js causing the search-index.json file to be empty.
I just had to specify the forceIgnoreNoIndex: true setting in the @easyops-cn/docusaurus-search-local theme block.
Hope that helps someone spend less time than I did — it's probably beneficial to add a log message suggesting that change.