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

Contextual results are missing their context description #424

Closed bentookey-yotta closed 4 months ago

bentookey-yotta commented 4 months ago

We're currently using Docusaurus v3.2 and easyops v0.40.1 with contextual search configured.

In v0.44, when searching within a context (e.g. the "Concepts" section), most search results are lacking their context description and have incomplete breadcrumbs. The standard "Everywhere" context seems unaffected.

This was introduced in v0.41 presumably by https://github.com/easyops-cn/docusaurus-search-local/issues/344.

v0.44:

easyops-v44

v0.40

live

Config

      {
        docsRouteBasePath: '/',
        indexDocs: true,
        indexBlog: false,
        indexPages: false,
        explicitSearchResultPath: true,
        searchBarShortcutHint: true,
        // `hashed` is recommended as long-term-cache of index file is possible.
        hashed: true,
        searchContextByPaths: [
          { label: 'Concepts', path: 'basics/fundamentals' },
          { label: 'Alloy Web', path: 'web' },
          { label: 'Alloy Mobile', path: 'mobile' },
        ],
        useAllContextsWithNoSearchContext: true,
        ignoreCssSelectors: '.search-ignore',
        ignoreFiles: [/.*getting-started.*\/alloy-search.*/],
      },

Unfortunately, this blocks us from updating Docusaurus (as v3.4 introduces the "duplicate URL" bug solved in v0.41.1). Hopefully, it can be resolved in due course 🙂

weareoutman commented 4 months ago

Did you specified keywords in front matter of your relevant docs?

Currently, keywords take precedence over content in search index, which would cause search results lacking content part. But this should not be affected by searching within or without a context.

Could you share a repro link?

bentookey-yotta commented 4 months ago

Thanks for the quick response. Our repo is private but I've uploaded an affected build to Netlify (v0.44, Docusaurus v3.4): magical-sopapillas-59e9f2.netlify.app Live site: help.alloyapp.io

None of our docs include the keywords or tags front matter.

weareoutman commented 4 months ago

Fixed in 0.44.1

Thanks for reporting.