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

Is it possible for this local search plugin to implment the facetfilter settings of the algolia search plugin #380

Open
AnthonyTsu1984 opened this issue Dec 12, 2023 · 3 comments

Comments

@AnthonyTsu1984
Copy link

image

Hi!

The local search plugin is very good enough for us to implement local searches!

However, I have tried to tweak the plugin options to achieve separation of the results from different versions but with no luck.

Is it possible for this local search plugin to implement such separation, or how?

The following is my setting right now:

  themes: [
    [ '@easyops-cn/docusaurus-search-local', {
      hashed: true,
      indexBlog: false,
      language: ['en', 'zh'],
      docsDir: ['docs', 'reference'],
      docsRouteBasePath: 'docs',
      highlightSearchTermsOnTargetPage: true,
      searchContextByPaths: ['/docs/tutorials', '/reference/api'],
      explicitSearchResultPath: true,
    }],

and no matter what, the search results contain items from both versions

@weareoutman
Copy link
Member

Separation of the results from different versions is already supported.

Try our demo https://easyops-cn.github.io/docusaurus-search-local/ , switch between next and 1.0.0, and enter style in the search bar.

Though I noticed we have to refresh the page after switch versions to make it work, so try refresh to see if it works for you. This problem maybe introduced by Docusaurus v3, but not sure, will look into it later.

@AnthonyTsu1984
Copy link
Author

That works! Thanks very much.

Manually refreshing the page after version switch brings the search context back on track. Although trivial but still hope the implementation of an automatic restoration of the search context after version switches.

@lyleaigbedion
Copy link

Hi any updates on this?

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

No branches or pull requests

3 participants