easyops-cn / docusaurus-search-local

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

When I have multi product docs, how to filter the search result? #394

Closed heywalter closed 10 months ago

heywalter commented 10 months ago

We have 2 product documents in one document center. How can we filter the search results? For example, I only want to search for content in the first product document.

For more info about how to deploy multi-instance in one document center, see Docs Multi-instance.

weareoutman commented 10 months ago

It's already supported, but require some config. See example in https://github.com/easyops-cn/docusaurus-search-local/blob/master/website-multi-docs/docusaurus.config.js#L156-L172

For the options detail, please refer to the project homepage.

heywalter commented 10 months ago

Excuse me, is it something like this, we can specify the scope when searching or filtering the product? iShot_2024-01-12_10 34 52

weareoutman commented 10 months ago

No, it will be filtered by current page URL. If you're visiting /product/*, the search scope will be limited to product pages. If you're visiting /community/*, the search scope will be limited to community pages.