feat(search): full unique path first + immediate folder in results (#51)
Release Please / Release Please (push) Skipped
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 21s
Tests / Test (Go stable) (pull_request) Successful in 26s

This commit is contained in:
Yftyr
2026-09-16 21:19:32 +00:00
parent 54f825f8e8
commit a3ef83a961
6 changed files with 137 additions and 7 deletions
+6 -1
View File
@@ -71,7 +71,12 @@ func searchCmd() *cobra.Command {
}
rows := make([]map[string]any, 0, len(hits))
for _, h := range hits {
folderPath := h.Path
if len(folderPath) == 0 && h.ParentID != "" {
folderPath = []string{h.ParentID}
}
rows = append(rows, map[string]any{
"path": c.UniquePath(cmd.Context(), folderPath, h.Title),
"id": h.ID,
"title": h.Title,
"folder": h.ParentID,
@@ -83,7 +88,7 @@ func searchCmd() *cobra.Command {
printJSON(rows)
return nil
}
printTable([]string{"id", "title", "folder", "score", "highlight"}, rows)
printTable([]string{"path", "id", "title", "folder", "score", "highlight"}, rows)
return nil
},
}