Coffee Search extends the Coffee launcher with a prefix-command live search. Type a short prefix followed by a query (e.g. n keyword) to get live suggestions from a pluggable search provider, without leaving the launcher.

Features

  • Live prefix search inside Coffee's Alt+D launcher. Each keystroke filters in real time (debounced 200 ms). The number of rows follows Coffee's Max results setting (default 7).
  • Built-in node-title provider on the n prefix. Type n (with a trailing space) to see the most recently changed published nodes; add keywords to filter. Honours node access.
  • Pluggable provider API: implement SearchProviderInterface and tag the service with coffee_search.provider to claim another prefix.

How it works

The user types a prefix (e.g. n) followed by a space, which puts the launcher in prefix mode. The JS dispatches subsequent queries to /coffee-search?prefix=n&q=<query>, which routes to a provider via a tagged service iterator. The provider returns JSON suggestions that render inside Coffee's existing autocomplete list.

Performance

The bundled node-title provider uses a SQL LIKE '%keyword%' query against the node title column. That is fine for the small-to-mid admin-convenience use case; on sites with tens of thousands of published nodes, heavy hook_node_grants implementations, or a shared DB server, the per-keystroke cost will become noticeable on top of the 200 ms debounce. See the README for details.

Related projects

  • Coffee — required dependency.

Project information

Releases