docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Nothing appears, no debug logs, no search index file or errors

Open alexgurr opened this issue 2 years ago • 3 comments

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",
Screenshot 2023-10-31 at 2 20 15 pm

alexgurr avatar Oct 31 '23 03:10 alexgurr

Same issue here, did you figure it out?

mlagergren avatar Jan 05 '24 14:01 mlagergren

Same solution for me: https://github.com/easyops-cn/docusaurus-search-local/issues/206

mlagergren avatar Jan 05 '24 15:01 mlagergren

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.

juan-belmonte avatar Jan 14 '24 22:01 juan-belmonte