Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local search with noIndex: true [feature request], was: No search results on local build #385

Closed
techbridgedev opened this issue Dec 18, 2023 · 2 comments · Fixed by #387

Comments

@techbridgedev
Copy link

I installed the plugin per the instructions.

I do not have a blog directory on my site.

My config looks like this:

      [
        require.resolve("@easyops-cn/docusaurus-search-local"),
        ({
          hashed: true,
          highlightSearchTermsOnTargetPage: true,
          explicitSearchResultPath: true,
          indexBlog: false,
          indexPages: true
        })
      ]
    ],

Then I ran the build & started the server with npm run serve to serve from the build directory. Every search query returns empty ("no results").

I also ran the build with debug but saw no errors.

@techbridgedev
Copy link
Author

The cause was the noIndex option in my config. The site is not for public consumption so I was discouraging search engines from crawling the site. So I'm turning this into a feature request: can we have an option to use noIndex: true but also have internal search work?

@techbridgedev techbridgedev changed the title No search results on local build Local search with noIndex: true [feature request], was: No search results on local build Dec 18, 2023
@weareoutman
Copy link
Member

weareoutman commented Dec 19, 2023

V0.38.0 introduced the feature: ignore unlisted content (the noIndex option has the similar effect). Your can try previous versions to see it it works for you.

Maybe we can add an option to force enable local search even if noIndex is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants