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

(excluding results) Excluding results isn't working #403

Closed Zenahr closed 6 months ago

Zenahr commented 6 months ago

We've got some docs that we add/don't add to the sidebars.js based on the hosting location. We had thought that if docs are not part of the sidebars.js, they would not come up in search. That's not the case however.

We tried excluding the docs like so: (they live under /docs/Controller/brand_ensto/**

ignoreFiles: ['/brand_1/', '/Controller/brand_1/', '**/brand_1/**', '/brand_1/**']

But this didn't work.

weareoutman commented 6 months ago

If docs are not part of the sidebars.js, they would not come up in search

No, sidebars.js only declares which links to display on the sidebar.

Put regexes instead of strings for ignoreFiles as the README said, so try:

ignoreFiles: [/\/brand_1\//, ...]

Note that the regexes should be URL paths instead of source file paths.