Search: guard navigation_* rank features against penalty default#3607
Search: guard navigation_* rank features against penalty default#3607Mpdreamz wants to merge 1 commit into
Conversation
…ty default navigation_depth and navigation_table_of_contents are rank_feature fields with NEGATIVE score impact; the shared contract defaults missing values to 50, which is a penalty. Add regression tests asserting CommonEnrichments always assigns explicit, non-default values across every navigation shape it's called with (root, node, leaf, and the null-navigation OpenAPI path). Writing these tests surfaced a real bug: the API navigation_section override checked doc.Type == "api", but DocumentationDocument.Type is a fixed CLR/$type discriminator that always returns "docs" — OpenApiDocumentExporter actually sets ContentType = "api". The override could never fire. Fixed to check doc.ContentType instead. CommonEnrichments is changed from private to internal (with InternalsVisibleTo already granted to Elastic.Markdown.Tests) so it can be exercised directly without spinning up a full markdown build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches✨ Simplify code
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 |
|
Label error. Requires exactly 1 of: automation, breaking, bug, changelog:skip, chore, ci, dependencies, documentation, enhancement, feature, fix, redesign. Found: |
Summary
navigation_depth/navigation_table_of_contentsarerank_featurefields with NEGATIVE score impact; the shared search contract defaults missing values to 50, which is a penalty. Add regression tests locking in thatCommonEnrichmentsalways assigns explicit, non-default values — across a landing/root page, a release-notes root, a section node, a deep leaf page, and the OpenAPI path where there's no navigation item at all.navigation_sectionoverride checkeddoc.Type == "api", butDocumentationDocument.Typeis a fixed CLR/$typediscriminator that always returns"docs"—OpenApiDocumentExporteractually setsContentType = "api". The override could never fire, so API reference pages never gotnavigation_section = "api". Fixed to checkdoc.ContentTypeinstead.CommonEnrichmentschanged fromprivatetointernal(InternalsVisibleTo already grantsElastic.Markdown.Testsaccess) so it can be exercised directly with lightweight navigation fakes instead of a full markdown build.Test plan
dotnet test tests/Elastic.Markdown.Tests— newNavigationEnrichmentTests(6/6 pass)Elastic.Markdown.Testssuite run; 14 pre-existing failures are unrelatedScopedFileSystem/git-checkout tests failing in this worktree environment, not touched by this changedotnet format/ lint clean (pre-push hook passed)