clawdex/docs/search.md
Peter Steinberger be315dd311
docs: add clawdex.sh feature pages and Rolodex-themed site
Adds 14 per-feature docs pages under docs/ covering install, quickstart,
people, notes, timeline, search, avatars, imports, vCard export, git
sync, markdown storage, doctor, and config. Replaces the placeholder
landing page with a single-page Rolodex/index-card site that fetches and
renders the docs client-side via marked + highlight.js, with code syntax
highlighting and dark-mode support. .nojekyll keeps GitHub Pages serving
the markdown files raw to the SPA.
2026-05-08 16:50:41 +01:00

2.1 KiB

Search

clawdex search <query> finds people and notes that match a substring. It's a local, offline, full-corpus search — no external service.

clawdex search dinner
clawdex search sally@example.com
clawdex search +1555
clawdex search "negroni recipe"
clawdex search whatsapp --json

What gets searched

  • Person names, IDs, and tags
  • Person emails and phone numbers (normalized)
  • Note bodies, kinds, sources, and topics

Hits are printed one per line, with the kind, name, a snippet, and the file path:

person   Sally O'Malley   sally@example.com                 people/sally-o-malley/person.md
note     Sally O'Malley   ...follow up about dinner...      people/sally-o-malley/notes/2026-05-08T09-15-00Z-whatsapp.md

--json returns a list of SearchHit objects; --plain swaps the snippet for the stable ID, which is friendlier to scripts.

How matching works

The query is a case-insensitive substring match against indexed fields. For phone numbers the search normalizes both the query and the stored value (strips spaces, dashes, parentheses, and a leading +), so any of these find Sally:

clawdex search "+1 555 0100"
clawdex search "(555) 0100"
clawdex search 15550100

For emails the match is plain substring against the lowercase value, so gmail.com works as a "find everyone on Gmail" query.

Combine with timeline and grep

search is for finding the right thread; once you've got it, use timeline for the full history of that person, or rg for free-form regex on the data repo:

clawdex search "ankara"
clawdex timeline mehmet
rg -n "ankara" ~/.clawdex/contacts/people

Indexes

Derived indexes live under index/:

index/
  emails.json
  phones.json
  handles.json

These are rebuilt automatically as the markdown changes. They are derivable, not authoritative — delete the folder and clawdex regenerates it on the next read. Markdown is canonical; see Markdown Storage.