docs: fix search ranking, add relevance smoke test and heading discoverability - #847
Open
kaviththiranga wants to merge 4 commits into
Open
docs: fix search ranking, add relevance smoke test and heading discoverability#847kaviththiranga wants to merge 4 commits into
kaviththiranga wants to merge 4 commits into
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
kaviththiranga
force-pushed
the
fix/search-ranking-smoke-test
branch
from
September 7, 2026 09:19
20abc85 to
fe2ff6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Searching the docs returned everything except the page you wanted. "Authorization" ranked the authorization overview at #57, and the top 20 results were just 5 pages — 4 of them AuthzRole CRD references.
Two causes in the Algolia index config:
searchableAttributessearchedhierarchy.lvl0(the sidebar category label) ahead oflvl1(the page's H1). The API-reference category is labelled exactlyAuthorization, so its CRD pages beat the guide titled "Authorization in OpenChoreo".attributeForDistinctwasurl, which includes the anchor — so one page contributed a record per heading and could fill every slot.Fixed in the Algolia dashboard (not in this PR)
hierarchy.lvl0moved afterlvl6;attributeForDistinct→url_without_anchorwithdistinct: 2; both mirrored into the crawler'sinitialIndexSettingsso a reindex can't revert them;/docs/category/*stubs no longer indexed.authorizationrbacobservabilitycustom roles/cel conditionsIn this PR
scripts/search-smoke.mjs— replays the site's real search query and asserts the expected page ranks and that results span ≥8 distinct pages. No dependencies. Daily workflow +npm run test:search.scripts/ALGOLIA.md,algolia-index-settings.json— the Algolia config only lived in a dashboard with no change history. Now reviewable and restorable.Anchors are pinned to their original IDs, so existing links keep working. Applied to both
docs/andversioned_docs/version-v1.2.x/— the live/docs/*pages come from the versioned copy.