Repository navigation
Fix Algolia search ranking, record extraction, and modal breadth - #160
Merged
Merged
Conversation
Fixes inverted weight.level rankings, DOM-order weight.position bias on MP Catalog pages, redundant API method sub-section records, glued HTML text, missing API code identifiers, and filters-before-attribute ranking so MP Catalog entries, current API method pages, and product guides rank above Release History revisions. Closes #159
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.
Summary
Fixes the Algolia DocSearch crawler extraction, ranking configuration, and navbar modal query parameters so MP Command Catalog entries, current API method pages, and product guides rank ahead of API Release History revisions and sub-section records.
Root Causes Addressed
weight.level: Custom API records usedlevel: 1forlvl1pages andlevel: 2forlvl2sub-sections and Release History revisions underdesc(weight.level), ranking Release History and sub-sections above current method and guide pages.weight.positionon MP Catalog pages: Catalog commands used 0-based page heading order (0..58), so only the singleposition: 0command per group page (e.g.,Construct a Vector Group - Group to Group Compare) tied withposition: 0Release History records, buryingConstruct a Point in Working Coordinates(position: 1) andConstruct a Point at line MidPoint(position: 5).search_termsflattening attribute ranking & missing code identifiers:search_termsatsearchableAttributes[0]bypassed heading hierarchy across sub-sections and missed actual differing code identifiers (includingConstructPointInWorkingCoordinates,.NET *Asyncmethods, nested C#Task<...>returns, and TypeScriptexport declare functiondeclarations).attributeForDistinct: 'url': 8,020 current method pages emitted 28,110 records (including 8,020 copies of group-levelExecution Notesboilerplate and"MP Catalog · gRPC Contract"lvl1snippets), whileattributeForDistinct: 'url'prevented page-level deduplication on guides and multi-revision history pages.filtersbeforeattributeinrankingand modal saturation on API routes: Contextual APIoptionalFilterscaused body-text mentions inside/api/<family>/...to outrank exact-title product guides (install,readiness,control center), and ungrouped family/release boosts could fill all modal candidates with one API family or shared client release versions (0.4.0)..api-code-barnoise, and premature character truncation: Adjacent cells/blocks concatenated without spaces (FieldNameType,InputPoint Name,C#public Task),.api-code-barlabels polluted"C#"searches with thousands of.NETsignatures, and fixed character slicing dropped searchable parameter notes well below 10 KB while risking oversize multibyte records.Key Changes
search/algolia-crawler.cjs:title,distinct_key, and family-scopedapi_family_releasefields; setsearchableAttributes[0]to'title,search_terms',attributeForDistinctto'distinct_key', and quoted'YOUR_INDEX_NAME'ininitialIndexSettingsso spaced index names parse cleanly when substituted.'api_family_release'toattributesForFaceting.weight.pageRank/weight.leveltiers (Product Guides>Current MP Catalog&API Guides>Current API Methods[equal across SA 2024 and SA 2026] > non-current catalog dispositions >Release History) with title-length tie-breaking (weight.position).lvl1record per current API method page (plus a deduplicated#first-call-walkthroughrecord where present), uses language-scoped code-identifier extraction (coveringproto,csharpnested generics,pythondef, and TypeScriptexport declare function/interfacemembers without Python body false positives), strips.api-code-bar, uses block-aware text extraction (nodeText), and trims strictly against a 9,500-byte UTF-8 serialized JSON budget (fitRecord) while ordering gRPC field tables and notes ahead of repeated protomessagedefinitions.filtersafterexactinrankingand addedseparatorsToIndex: '#'; kept hosted Algolia editor compatibility (new Crawler({first, no?.or??).src/components/ApiReference/context.ts&src/theme/SearchBar/index.tsx:searchFilters()to pair active API boosts with'docusaurus_tag:docs-catalog-current'using Algolia OR sub-arrays, boost current release tag(s) on current and family/history routes so Release History does not crowd out sibling APIs, and scope earlier-release boosts viaapi_family_release:<family>-<release>.hitsPerPageto40andmaxResultsPerGroupto6.search/crawler.test.cjs,tests/api-reference.test.cjs, &README.md:YOUR_INDEX_NAMEsubstitution, ranking tiers, non-DOM-order catalog weights, language-scoped identifier extraction (setSaWindowState,ConstructBSplinesFromSurfacesAsync, Python body noise), UTF-8 byte-budget preservation (Direct CAD Accesssurface_normals_mode/"MP qualifier: 1 or 2."and BMP + emoji surrogate-pair cutoffs),MP Value Types,distinct_key, and"construct a"modal breadth across/, current SA 2026 gRPC, history, earlier server (0.7.0), and earlier shared client (0.4.0) routes.api_family_release), expected ~40% record-count reduction safety-check notice, and updated the onboarding deployment workflow reference todeploy-workers.yml.Validation
v24.22.3:npm run typecheck, search-enablednpm run build,npm run check:search(14/14 passed),npm run check:seo(48/48 passed), andgit diff --check."construct a","construct a point","ConstructPointInWorkingCoordinates","ConstructPointInWorkingCoordinatesAsync","setSaWindowState","ConstructBSplinesFromSurfacesAsync","surface_normals_mode","MP qualifier: 1 or 2","GetWorkingDirectory","install","readiness","control center","C#","Value Types","PointName","ConnectToSpatialAnalyzer","SA 2024","Run Crib Sheet", and"0.7.0 Angle Between Line and Plane"across homepage, current SA 2026/2024, family/history, earlier server (0.7.0), and earlier client (0.4.0) routes.Post-Merge Hosted Algolia Rollout
After merge and deployment to
briosa.dev:search/algolia-crawler.cjsin the Algolia Crawler editor (keeping hosted credentials, index name, schedule, and safety checks).Briosa Documentation Websiteindex settings in the Algolia Dashboard:searchableAttributes:["title,search_terms", "unordered(hierarchy.lvl1)", "unordered(hierarchy.lvl2)", "unordered(hierarchy.lvl3)", "unordered(hierarchy.lvl4)", "unordered(hierarchy.lvl5)", "unordered(hierarchy.lvl6)", "unordered(hierarchy.lvl0)", "content"]ranking:["words", "typo", "attribute", "proximity", "exact", "filters", "custom"]attributeForDistinct:"distinct_key"camelCaseAttributes:["hierarchy", "content", "title"]separatorsToIndex:"#"attributesForFaceting:["type", "lang", "language", "version", "docusaurus_tag", "api_family", "api_release", "api_family_release", "sa_target"]maxLostRecordsPercentagefor this one-time drop, then restore it).Closes #159