Skip to content

improvement(search): rank an overflowing Confluence all-terms match with relevance search - #9001

Merged
waleedlatif1 merged 7 commits into
stagingfrom
improvement/confluence-relevance-search
Oct 14, 2026
Merged

waleedlatif1 merged 7 commits into
stagingfrom
improvement/confluence-relevance-search

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A plain Confluence query runs an all-terms text ~ search. When more pages match every word than fit on one page, Confluence orders them by raw term matches, so on a large site the right page is often missing from the page returned (measured on a large site with real natural-language questions: the expected page was in the top 10 for 0 of 11 queries with text ~, 7 of 11 with siteSearch)
  • That overflowing page is now fetched from siteSearch, the relevance search behind Confluence's own search box, which weights titles and rarer words
  • An all-terms match that fits on one page, date-sorted listings, and native CQL are unchanged, and the underfilled case keeps its existing relevance fallback; on a small site the change never triggers (0 of 61 distinct benchmark searches), so requests and results are identical there
  • A relevance-ranked page reports hasMore without a cursor, since a cursor would continue a different query; the account message says so and points to native CQL for paging

Type of Change

  • Improvement

Testing

  • New searchAtlassian tests: an overflowing all-terms match is ranked by relevance (no cursor, hasMore set); a match that fits stays as is with a single search request; date-sorted and native queries keep the all-terms page and its cursor. Every guard mutation-checked
  • bun run --cwd apps/sim test lib/sim-search lib/knowledge: 2,083 tests pass; biome clean
  • Three-way MCP-client benchmark (pre-change baseline / staging / this branch) on a staging data set: no Confluence page triggered the new path, so behavior is identical to staging there
  • type-check and check:audits run in CI

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)

…ith relevance search

A plain Confluence query runs an all-terms text ~ search. When more pages match every word than fit on one page, Confluence orders them by raw term matches, so on a large site the right page is often not on the page returned. That page is now fetched from siteSearch, the relevance search behind Confluence's own search box, which weights titles and rarer words. An all-terms match that fits on one page, date-sorted listings, and native CQL are unchanged; the underfilled case keeps its existing relevance fallback. A relevance-ranked page reports hasMore without a cursor, since a cursor would continue a different query.
@vercel

vercel Bot commented Oct 14, 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 14, 2026 12:48am 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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Confluence now uses relevance search when an all-terms match overflows one page.

  • Overflowing plain Confluence searches show relevance-ranked results.
  • Provider searches receive the account session’s cancellation signal.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[All-terms search succeeds] --> B{Plain query overflows?}
  B -->|No| C[Return original page]
  B -->|Yes| D[Request relevance-ranked page]
  D -->|Success| E[Return ranked page without cursor]
  D -->|Failure| F{Caller cancelled?}
  F -->|Yes| G[Throw cancellation reason]
  F -->|No| H[Keep original page and cursor; mark partial]
Loading

Reviews (7) · Last reviewed commit: "fix(search): give provider searches the ..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated

@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 2 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

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated
…g fails

A provider error on the optional relevance request (rate limit, refusal) now keeps the all-terms page and its cursor instead of failing the site, and with it the account's other sites. Cancellation and transport errors still propagate. Relevance-ranked and ranking-unavailable pages are reported as partial.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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 2 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

…on ranking failure

The client's own request timeout and transport failures surface as plain errors, so keeping the page only for provider errors still dropped it on a slow relevance request. Any failure other than cancellation (an AbortSignal reason) now keeps the all-terms page.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

The failure cases re-mocked the client with an optional call that could return undefined, which the test type check rejects. The helper now takes the relevance result or a throwing function, and the provider-refusal and timeout cases share one table test.

@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 2 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

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated

@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 2 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

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

…r its reason

A search stopped with a non-error abort reason (a string) surfaced from the HTTP client unchanged, so the relevance-ranking fallback treated it as a ranking failure and returned results after the stop. Provider searches now carry the account session's signal, and the fallback checks it instead of the error's type.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@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 2 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

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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
waleedlatif1 merged commit 2abc906 into staging Oct 14, 2026
40 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/confluence-relevance-search branch October 14, 2026 00:52

This branch was previously deployed

1 inactive deployment
Preview — a1c83f42 Deployed Oct 14, 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