01Most "global search" is per-module search
A search box in the header that only queries whatever module you're currently viewing isn't global search — it's a filter with a bigger ambition in its label. Real global search means one query, one keystroke to open it from anywhere, and results spanning every entity type a user might be looking for: clients, projects, documents, tasks, invoices.
That's a harder problem than it looks, because each of those entity types usually lives behind a different API, a different permission model, and a different "open this result" navigation path.
02What separates good search from a box that queries an API
-
01
One global keyboard shortcut
Cmd/Ctrl+K opens search from anywhere in the app, focus already in the input. If a user has to reach for the mouse to start searching, the feature will be underused.
-
02
Group results by entity type
A flat list mixing clients, invoices and documents forces users to read every row. Grouped, labeled sections let them jump straight to the type they're after.
-
03
Debounce, don't throttle the first keystroke
Debounce requests as the user types, but never delay the very first character's request. That first response is what convinces someone the feature is fast.
-
04
Preview before navigating
A hover or arrow-key preview of a task or document saves a full page navigation for the common case of "just checking," and keeps the search panel open for the next query.
-
05
Respect permissions in the index, not the UI
Filtering results a user can't access after they've already appeared on screen is both a security bug and a confusing flash of content. Filter server-side, before the response is built.
-
06
Design the zero-results state
A blank panel after a query reads as broken. Suggest a spelling correction, a broader term, or a fallback action such as "create a new client named…" instead of silence.
04Signals in, RxJS for the stream
The search box itself is a signal; the request pipeline is RxJS, because that's where debouncing and cancellation belong. toObservable bridges the two, switchMap cancels stale requests, and toSignal hands grouped results back to the template.
The global shortcut is a host listener on the search component, so it works from any module without each page wiring it up. On an accounting SaaS this pattern backed cross-module search with session history and full keyboard navigation.
@Component({
selector: 'app-global-search',
host: {
'(document:keydown.control.k)': 'open($event)',
'(document:keydown.meta.k)': 'open($event)',
},
templateUrl: './global-search.component.html',
})
export class GlobalSearchComponent {
private search = inject(SearchApi);
query = signal('');
results = toSignal(
toObservable(this.query).pipe(
map((q) => q.trim()),
debounceTime(150),
distinctUntilChanged(),
switchMap((q) => (q.length < 2 ? of(EMPTY_GROUPS) : this.search.grouped(q))),
),
{ initialValue: EMPTY_GROUPS },
);
open(e: Event) { e.preventDefault(); /* show overlay, focus input */ }
}
The takeaway
Global search earns its name through keyboard access from anywhere, grouped and previewable results, permission filtering at the source, and a navigation layer decoupled from the search component itself. Get those right and it stops feeling like a filter with a bigger label — it becomes the fastest way through the product.