Skip to content

feat(index): match underscore-delimited tool-name segments in search - #1535

Merged
Dumbris merged 2 commits into
mainfrom
fix/issues-w5b7-internal-index-bm25-query
Oct 6, 2026
Merged

Dumbris merged 2 commits into
mainfrom
fix/issues-w5b7-internal-index-bm25-query

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

Bare search queries such as issue never matched tools like github:create_issue, because tool_name is keyword-analyzed and only prefix/exact clauses applied. This adds matching on underscore-delimited tool-name segments.

Items

  • Follow-ups from Spec 108-k macOS profiles review (#1442) #1449 (internal/index BM25 query)
    • Root cause: the keyword-analyzed tool_name field has no segment tokens, so a bare word that is a middle or trailing segment of a snake_case name produced no hit.
    • Change: add a bare-segment wildcard clause (3+ alphanumeric chars) under the same adaptive rule as the existing underscore enhancement. It applies only when no exact tool-name match is already on top. A second commit skips the clause entirely when no tool name contains the segment, so scores and frozen goldens stay byte-identical for queries with no segment hit.
    • Test: new index tests cover segment matches and confirm that exact-name scores and the ranking goldens are unchanged.

Skipped items

None.

Design choice

Option taken: a wildcard Should clause on tool_name for bare segments, boosted below the prefix clause (bare segment 1.5 vs prefix 3.0), applied only when no exact match leads. The alternative was changing the analyzer to tokenize on underscores, which would require a full reindex and shift every frozen score and golden. Trade-off: the boost ratio is a heuristic. Both clauses score per term with BM25 idf, so a rare segment-only hit can outrank a common prefix hit. This awaits maintainer review.

Review Status

Clean after 1 round. Unresolved findings: glm:1.1 (low, deferred). The "existing top results keep order" invariant rests only on the boost ratio, for the reason given under Design choice.

Refs #1449

…ueries

A bare query such as "issue" never matched create_issue because tool_name
is keyword-analyzed. Add a bare-segment wildcard clause (3+ alphanumeric
chars) under the same adaptive rule as the underscore enhancement: only when
no exact tool-name match is already on top, so frozen exact-name scores and
ranking goldens are unchanged.

refs #1449
Keeps scores and frozen goldens byte-identical for queries with no segment
hit; the extra Should clause would otherwise shift BM25 query normalization.

refs #1449
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 924ab8b
Status: ✅  Deploy successful!
Preview URL: https://48f8914b.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-issues-w5b7-internal-ind.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/index/bleve.go 92.30% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/issues-w5b7-internal-index-bm25-query

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (27 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-go1D1A04.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 37451880551 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris enabled auto-merge (squash) October 6, 2026 17:24
@Dumbris
Dumbris merged commit bd6da00 into main Oct 6, 2026
54 of 55 checks passed
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.

2 participants