[PR #27] [MERGED] fix: relax search token matching to require at least one match #218

Closed
opened 2026-02-15 17:16:20 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/27
Author: @afmire877
Created: 1/24/2026
Status: Merged
Merged: 1/24/2026
Merged by: @steipete

Base: mainHead: fix/search-token-matching


📝 Commits (4)

  • 92425b4 fix: relax search token matching to require at least one match
  • 89896b1 fix: update matchesExactTokens to require prefix matching for query tokens
  • d7a37a4 more inclusive token check
  • bfbf7b5 Update convex/lib/searchText.ts

📊 Changes

2 files changed (+20 additions, -4 deletions)

View changed files

📝 convex/lib/searchText.test.ts (+16 -2)
📝 convex/lib/searchText.ts (+4 -2)

📄 Description

Summary

  • Changed search token matching from requiring ALL query tokens to requiring AT LEAST ONE token
  • This fixes searches returning no results when not all keywords appear in the skill metadata
  • Vector similarity now properly determines relevance instead of being over-filtered

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() in matchesExactTokens() so at least one token must match. This keeps a minimal keyword filter while allowing vector similarity to determine relevance.

Test plan

  • All 283 existing tests pass
  • Updated test reflects new behavior
  • Manual test: search for multi-word queries and verify results appear

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/27 **Author:** [@afmire877](https://github.com/afmire877) **Created:** 1/24/2026 **Status:** ✅ Merged **Merged:** 1/24/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `fix/search-token-matching` --- ### 📝 Commits (4) - [`92425b4`](https://github.com/openclaw/clawhub/commit/92425b4acaee73a1a3b3b196286f70675ce34d6b) fix: relax search token matching to require at least one match - [`89896b1`](https://github.com/openclaw/clawhub/commit/89896b1f3fa286c3228abd2d6999368e0cb68828) fix: update matchesExactTokens to require prefix matching for query tokens - [`d7a37a4`](https://github.com/openclaw/clawhub/commit/d7a37a4fc4373981c05727d1779ea09579a5e137) more inclusive token check - [`bfbf7b5`](https://github.com/openclaw/clawhub/commit/bfbf7b5769375f1208485b699687de83b171ee93) Update convex/lib/searchText.ts ### 📊 Changes **2 files changed** (+20 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `convex/lib/searchText.test.ts` (+16 -2) 📝 `convex/lib/searchText.ts` (+4 -2) </details> ### 📄 Description ## Summary - Changed search token matching from requiring ALL query tokens to requiring AT LEAST ONE token - This fixes searches returning no results when not all keywords appear in the skill metadata - Vector similarity now properly determines relevance instead of being over-filtered ## 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()` in `matchesExactTokens()` so at least one token must match. This keeps a minimal keyword filter while allowing vector similarity to determine relevance. ## Test plan - [x] All 283 existing tests pass - [x] Updated test reflects new behavior - [x] Manual test: search for multi-word queries and verify results appear 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:20 -05:00
yindo closed this issue 2026-02-15 17:16:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#218