The workbench · free build, work shown

How to search everything you have with one query.

One search box over every kind of record, typo-tolerant, no search service to run or pay for.

Hand-drawn blueprint: How to search everything you have with one query
The blueprint · free to copy

Most apps make you search each thing separately: contacts here, deals there, notes somewhere else. I built one search box that finds all of it at once, with typo tolerance, using nothing but the database the app already runs on. Here is how.

Six parts, and there is no search service to run or pay for.

  1. One function over everything. A single database function searches across every record type at once, people, deals, notes, tasks, and more.
  2. Forgive typos. It uses trigram matching, so a misspelled search still finds the right thing.
  3. Cover every kind of record. One query, seven entity types, one ranked list of results.
  4. Plain Postgres, no add-ons. No separate search service like Elastic or Algolia to run, host, or pay for.
  5. Respect who can see what. The search runs under the user’s own permissions, so it only ever returns what they are allowed to see.
  6. Stay fast. A trigram index keeps it quick even as the data grows.

Any app with more than one kind of record, a CRM, a portal, an internal tool, gets better the moment search covers everything at once. If your team keeps three tabs open just to find things, this is the fix, and the blueprint above is the whole design.

From a production CRM build. Everything described here is something I actually run; nothing on this bench is theoretical.

Get the next one.

Every other Tuesday. One useful thing for small business: a tool, a fix, or the build behind one.

Free · unsubscribe in one click · no forwarding your address