Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(search): enable wildcard prefix matching for search terms

Maximilian Roos7dea514ec458
diff --git a/docs/static/search.js b/docs/static/search.js
index b45e55ee5..65de1cbf6 100644
--- a/docs/static/search.js
+++ b/docs/static/search.js
@@ -54,8 +54,14 @@ document.addEventListener('keydown', function(e) {
return;
}
- var results = index.search(value, {
+ // Add wildcard suffix for prefix matching (e.g., "switc" matches "switch")
+ var searchTerms = value.split(/\s+/).map(function(term) {
+ return term + '*';
+ }).join(' ');
+
+ var results = index.search(searchTerms, {
bool: "OR",
+ expand: true,
fields: {
title: { boost: 2 },
body: { boost: 1 }