Skip to content

improvement(search): rank across sources by query terms only on the Search page - #9138

Closed
waleedlatif1 wants to merge 1 commit into
stagingfrom
improvement/search-tab-relevance-only
Closed

waleedlatif1 wants to merge 1 commit into
stagingfrom
improvement/search-tab-relevance-only

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • improvement(search): rank live results across sources by the query terms they hold #9134 ordered every plain live search across sources by the query terms each result holds. This keeps that order for the Search page's result list (/api/knowledge/search, its only caller) and returns MCP and assistant searches to fusion order, which interleaves sources by their own rank
  • New rankByRelevance input on searchLiveKnowledge, set only by that route

Why

  • Search page, live on prod after v0.9.25 (10 keyword queries from a customer's Search check): the authoritative page is first for 5/10, from 0/10 before improvement(search): rank live results across sources by the query terms they hold #9134; offline, nDCG@10 0.29 → 0.65 on 66 held-out queries
  • MCP client, end-to-end benchmark on the same tenant (Claude as the client, 12 questions × 4): v0.9.25 82.5 vs v0.9.24 82.8 (−0.4 [−2.9, 2.1]) and vs v0.9.23 85.2 (−2.7 [−4.8, −0.7]). The client ran fewer searches (2.4 → 1.9 per question, halved on the two questions that fell most) and missed facts that only follow-up searches had found: a relevance-ordered first page reads as complete to the agent
  • Fusion order is the last measured-good behavior for agent clients; relevance order can come back for them once an end-to-end benchmark shows a gain. With revert(search): restore the v0.9.23 Jira text search #9137 (Jira revert), MCP search is back to v0.9.23 behavior

Type of Change

  • Improvement

Testing

  • application.test.ts: the cross-source case now checks both surfaces — relevance order with rankByRelevance, fusion order without; it fails with the gate removed (59 pass)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…earch page

The Search page's result list keeps the cross-source relevance order (#9134).
MCP and assistant searches return to fusion order, which interleaves sources:
an end-to-end client benchmark found no gain from relevance order there, and
the client searched less.
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 16, 2026 9:09pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Closing in favor of one bundled PR once the change is proven end to end.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

This PR limits query-term ranking to the Search page. As explicitly intended by waleedlatif1, MCP and assistant searches return to fusion order.

  • The Search page ranks results by query terms while agents keep fusion order.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Page[Search page] --> Route[Internal search route]
  Route -->|rankByRelevance = true| Search[searchLiveKnowledge]
  MCP[MCP search] -->|Flag omitted| Search
  Assistant[Assistant search] -->|Flag omitted| Search
  Search --> Gate{Plain query and flag enabled?}
  Gate -->|Yes| Relevance[Query-term order]
  Gate -->|No| Existing[Existing fusion or date order]
Loading

Reviews (1) · Last reviewed commit: "improvement(search): rank across sources..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 deleted the improvement/search-tab-relevance-only branch October 16, 2026 21:18

This branch was previously deployed

1 inactive deployment
Preview — 6fdcc4bd Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant