bonitasoft / bonita-documentation-theme

Dedicated Antora UI Bundle used to produce the Bonita Documentation
https://bonitasoft.github.io/bonita-documentation-theme/
Mozilla Public License 2.0
4 stars 6 forks source link

feat: pass version aliases to DocSearch #181

Closed jeromecambon closed 1 year ago

jeromecambon commented 1 year ago

Pass both the actual version and the version aliases (latest or next) when available. This ensures a smooth transition when Antora will manage the latest and next aliases. DocSearch doesn't know the aliases until the site is in production and it has been re-indexed. During the transition, the search will work for readers (as indexed with the actual version) and also after the content has been re-indexed (using the alias).

In addition, remove the old commented code related to DocSearch click events. We will eventually enable it later.

Notes

See related PR: https://github.com/bonitasoft/bonita-documentation-site/pull/520

See issue: https://github.com/bonitasoft/bonita-documentation-site/issues/419

Tests

With the DocSearch client of the Crawler, when we select 2 versions for the search, here is the body of the request

{
  "requests": [
    {
      "query": "api",
      "indexName": "bonitasoft",
      "params": "attributesToRetrieve=%5B%22hierarchy.lvl0%22%2C%22hierarchy.lvl1%22%2C%22hierarchy.lvl2%22%2C%22hierarchy.lvl3%22%2C%22hierarchy.lvl4%22%2C%22hierarchy.lvl5%22%2C%22hierarchy.lvl6%22%2C%22content%22%2C%22type%22%2C%22url%22%5D&attributesToSnippet=%5B%22hierarchy.lvl1%3A10%22%2C%22hierarchy.lvl2%3A10%22%2C%22hierarchy.lvl3%3A10%22%2C%22hierarchy.lvl4%3A10%22%2C%22hierarchy.lvl5%3A10%22%2C%22hierarchy.lvl6%3A10%22%2C%22content%3A10%22%5D&snippetEllipsisText=%E2%80%A6&highlightPreTag=%3Cmark%3E&highlightPostTag=%3C%2Fmark%3E&hitsPerPage=20&facetFilters=%5B%5B%22version%3A7.11%22%2C%22version%3A7.10%22%5D%2C%5B%22tags%3Abonita%22%5D%5D"
    }
  ]
}

Versions parameter

facetFilters: [["version:7.11","version:7.10"],["tags:bonita"]]"}]}

-> This is consistent with what we get in the page source ✅

github-actions[bot] commented 1 year ago

:recycle: PR Preview 54d21a238bdd0e259cc5b7900577ca52dec68f6d has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information