Advanced search: operators, ranking, snippets, saved searches #20
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/2-advanced-search"
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?
Closes #2 (the Web Worker index from the issue is not included, see below)
What
lib/search.ts, pure and unit tested):word,"exact phrase",-excluded,title:,body:,tag:andnotebook:(case-insensitive,*wildcards;notebook:also matches notes in sub-notebooks),type:todo|note,iscompleted:0|1,created:/updated:as20260101,2026-01-01or relative-7d/-2w/-3m/-1y("on or after"),any:1for OR. Quoted text is always literal ("tag:work"is not an operator), unknown or half-typed operators (tag:) are ignored while typing, negation works on every operator.search(title = name, body = query): small backend change (TypeSearchinValidType), included in end-to-end encryption and the push order. Backend test: asearchitem syncs, unknown types are still refused.Tests
pnpm test(72; 12 new covering parsing, every operator, negation, any:1, wildcards + parent notebooks, dates absolute/relative/invalid, ranking, snippets),tsc,pnpm build,go test ./....Not included
shortcut:insearch.ts). Fast for thousands of notes; add the index when someone has far more. The tag/notebook lookup tables are cached per items snapshot.6172717a6058cb7c4d9d58cb7c4d9d7b0e9edf3e