fix: relax search token matching to require at least one match#27
Merged
steipete merged 4 commits intoopenclaw:mainfrom Jan 24, 2026
Merged
fix: relax search token matching to require at least one match#27steipete merged 4 commits intoopenclaw:mainfrom
steipete merged 4 commits intoopenclaw:mainfrom
Conversation
The search was requiring ALL query tokens to exist in the skill's displayName, slug, or summary. This was too strict and caused valid results to be filtered out. For example, searching "HTTP API client" would fail to match skills about "HTTP API" that didn't mention "client". Changed from `.every()` to `.some()` so at least one token must match, allowing the vector similarity to determine relevance for the rest. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
@ahmed-mire is attempting to deploy a commit to the Amantus Machina Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
steipete
added a commit
that referenced
this pull request
Jan 24, 2026
Contributor
|
Landed via temp rebase onto main.\n\n- Gate: bun run lint && bun run build && bun run test\n- Land commit: a695706\n- Merge commit: a16e624\n\nThanks @afmire877! |
aronchick
pushed a commit
to aronchick/clawhub
that referenced
this pull request
Feb 19, 2026
…law#27) * fix: relax search token matching to require at least one match The search was requiring ALL query tokens to exist in the skill's displayName, slug, or summary. This was too strict and caused valid results to be filtered out. For example, searching "HTTP API client" would fail to match skills about "HTTP API" that didn't mention "client". Changed from `.every()` to `.some()` so at least one token must match, allowing the vector similarity to determine relevance for the rest. * fix: update matchesExactTokens to require prefix matching for query tokens * more inclusive token check * Update convex/lib/searchText.ts --------- Co-authored-by: Ahmed <ahmed.mire@kaluza.com>
oolong-tea-2026
added a commit
to oolong-tea-2026/clawhub
that referenced
this pull request
Mar 17, 2026
When searching for a skill by its exact slug (e.g. 'ima-all-ai'), the result could be missing from the first page because: 1. The vector search candidate pool (75-256) might not include the skill 2. matchesExactTokens uses `.some()` (by design, see openclaw#27), so unrelated skills with common tokens like 'ai' inflate exactMatches count 3. When exactMatches >= limit, lexicalFallbackSkills is skipped entirely, along with its exact slug lookup via the by_slug index Fix: after all recall stages (vector + exactMatches + lexicalFallback), check whether the candidate slug (reconstructed from query tokens via `join('-')`) is present in merged results. If missing, perform a single O(1) index lookup via the new `lookupExactSlug` internalQuery. This ensures exact slug matches are never lost regardless of vector search coverage or the matchesExactTokens filtering threshold. Co-Authored-By: 戴硕 <daishuo@gmail.com>
oolong-tea-2026
added a commit
to oolong-tea-2026/clawhub
that referenced
this pull request
Mar 17, 2026
When searching for a skill by its exact slug (e.g. 'ima-all-ai'), the result could be missing from the candidate pool because: 1. The vector search candidate pool (75-256) might not include the skill 2. matchesExactTokens uses `.some()` (by design, see openclaw#27), so unrelated skills with common tokens like 'ai' inflate exactMatches count 3. When exactMatches >= limit, lexicalFallbackSkills is skipped entirely, along with its exact slug lookup via the by_slug index Fix: after all recall stages (vector + exactMatches + lexicalFallback), reconstruct the candidate slug from query tokens and check if it exists in merged results. If missing, perform a single O(1) index lookup via the new `lookupExactSlug` internalQuery to ensure it enters the candidate pool. It then participates in normal scoring and ranking — SLUG_EXACT_BOOST (1.4) makes it very likely to rank first, but the fix does not force any particular ranking. Co-Authored-By: 戴硕 <daishuo@gmail.com>
oolong-tea-2026
added a commit
to oolong-tea-2026/clawhub
that referenced
this pull request
Mar 17, 2026
When searching for a skill by its exact slug (e.g. 'ima-all-ai'), the result could be missing from the candidate pool because: 1. The vector search candidate pool (75-256) might not include the skill 2. matchesExactTokens uses `.some()` (by design, see openclaw#27), so unrelated skills with common tokens like 'ai' inflate exactMatches count 3. When exactMatches >= limit, lexicalFallbackSkills is skipped entirely, along with its exact slug lookup via the by_slug index Fix: after all recall stages (vector + exactMatches + lexicalFallback), reconstruct the candidate slug from query tokens and check if it exists in merged results. If missing, perform a single O(1) index lookup via the new `lookupExactSlug` internalQuery to ensure it enters the candidate pool. It then participates in normal scoring and ranking — SLUG_EXACT_BOOST (1.4) makes it very likely to rank first, but the fix does not force any particular ranking. Co-Authored-By: 戴硕 <daishuo@gmail.com>
oolong-tea-2026
added a commit
to oolong-tea-2026/clawhub
that referenced
this pull request
Mar 17, 2026
When searching for a skill by its exact slug (e.g. 'ima-all-ai'), the result could be missing from the candidate pool because: 1. The vector search candidate pool (75-256) might not include the skill 2. matchesExactTokens uses `.some()` (by design, see openclaw#27), so unrelated skills with common tokens like 'ai' inflate exactMatches count 3. When exactMatches >= limit, lexicalFallbackSkills is skipped entirely, along with its exact slug lookup via the by_slug index Fix: after all recall stages (vector + exactMatches + lexicalFallback), reconstruct the candidate slug from query tokens and check if it exists in merged results. If missing, perform a single O(1) index lookup via the new `lookupExactSlug` internalQuery to ensure it enters the candidate pool. It then participates in normal scoring and ranking — SLUG_EXACT_BOOST (1.4) makes it very likely to rank first, but the fix does not force any particular ranking. Co-Authored-By: 戴硕 <daishuo@gmail.com>
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
Problem
The search was requiring ALL query tokens to exist in the skill's displayName, slug, or summary. For example, searching "HTTP API client" would fail to match skills about "HTTP API" that didn't explicitly mention "client" - even though the vector search found them as semantically relevant.
Solution
Changed from
.every()to.some()inmatchesExactTokens()so at least one token must match. This keeps a minimal keyword filter while allowing vector similarity to determine relevance.Test plan
🤖 Generated with Claude Code