kbdb /entries/search keyword 路徑 source 參數解析後丟棄(#5.1 只做了一半) #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
現象(claude.ai 2026-07-19 實測):
GET /entries/search?q=...&source=gitea:Leo/kb@.../xxx.md不帶 mode(=keyword)時,回傳 45 筆完全不受 source 限制。根因(源碼核實,main):
kbdb/src/routes/entries.ts:67有解析source,但 keyword 分支:94呼叫searchEntries(DB, q, owner_id, entry_type, undefined, library)——searchEntries(actions/entry-crud.ts)函式簽名沒有 source 參數,解析完即丟。semantic 分支有傳(Vectorize metadata filter 正常);GET /entries列表也有接(#5.1 那半)。唯獨 search keyword 漏。修法:searchEntries 加
source?: string,conds 補json_extract(metadata_json,'$.source') = ?(與 listEntries #5.1 同款謂詞),route :94 傳入。出處:頂層 wiki status 2026-07-19 段;雲端總管代開。
修復 PR 已開:#70(#70)。
searchEntries尾端加source?+與 listEntries #5.1 同款 json_extract 謂詞,route keyword 分支與 semantic 降級分支兩處傳入。kbdb vitest 33/33 綠、tsc 0。與 #67 同 PR。merge 後需 gated redeploy kbdb worker(leo 閘)。✅ live 驗證過關單(leo21c
ff6be30b,雲端總管 2026-07-19 實測):/entries/search?q=KPI&source=<不存在值>回 0 筆、不帶 source 同 q 回 45 筆=謂詞已接上。