easyops-cn / docusaurus-search-local

Offline/local search for Docusaurus v2/v3
https://easyops-cn.github.io/docusaurus-search-local/
MIT License
671 stars 88 forks source link

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

Open AnthonyTsu1984 opened 7 months ago

AnthonyTsu1984 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 5 months ago

Hi any updates on this?

yanaxie commented 3 weeks ago

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.

HI, I encountered the same problem, are there any updates on this?