pagefind
Pagefind Search
Enterprise-grade site search with zero server overhead.
Pagefind Search brings the blazing-fast, Rust-powered
Pagefind engine to Drupal. Instead of running
and maintaining a search server like Solr or Elasticsearch, Pagefind builds a
highly compressed static index that is served as plain files and
queried entirely in the visitor's browser via WebAssembly — fetching only the
few kilobytes of index a given query actually needs.
The result is instant, typo-tolerant, faceted search that costs your server
nothing per keystroke, scales to tens of thousands of documents, and keeps
working even on fully static or CDN-fronted deployments.
Why Pagefind Search?
- No search server to run. No Solr, no Elasticsearch, no
background daemon, no per-query backend load. The index is a set of static
files. - Fast by design. Searches run in-browser over a compressed
index, downloading only the chunks a query needs — typically tens of
kilobytes — with no round-trip per keystroke. - Built for Drupal. A native bridge to Pagefind: view
modes, a field formatter, blocks, Views integration, Drush commands, and a
configuration UI — not a bolt-on.
Key features
- Expert field formatter. A single, unified formatter to
mark fields as filters, boost their search weight, expose them as metadata,
or make them sortable — directly from Manage display. - Faceted listing pages. Build filterable, sortable,
paginated archives, libraries and directories with the bundled display UI —
list, grid and table layouts, configurable columns, sidebars and pagination
styles. - Featured results. Promote chosen content to the top of
results for specific keywords. - Synonyms. Index-time synonym and equivalence expansion so
visitors find content regardless of the exact words they type. - Multisite search collections. Aggregate and search across
multiple sites. - Modern, themeable UI. Built on Pagefind's web components
(Shadow DOM compatible), with a keyboard shortcut, modal and inline display
modes. - Developer tooling. Drush commands for index builds and
diagnostics, plus a per-node "Pagefind preview" tab for inspecting exactly
what gets indexed.
How it works
- Enable the Pagefind Index view mode on your content types
and tag fields with the Pagefind Expert formatter. - Build the index from the dashboard, or with
drush pagefind:indexfor larger sites.
- Drop in the search block or visit
/search— queries run
instantly in the browser.
Requirements
- Drupal 10.3+ or 11
- PHP 8.3 or newer
- A private file system (
$settings['file_private_path']) for
staging and binary storage — the Pagefind binary is downloaded at runtime
into the private filesystem and is never web-accessible.
Scale & limits
Pagefind Search is engineered for sites with up to roughly
50,000 indexed documents. Within that envelope it delivers
excellent search with zero server query load. Above ~5,000 documents, build the
index via Drush rather than the browser batch UI. For very large corpora where
fine-grained relevance tuning is critical, a server-side backend may still be
the better fit.
Security & quality
The module is held to a high engineering bar: PHPCS-clean against the Drupal
and DrupalPractice standards, PHPStan level 8, a comprehensive kernel and
functional test suite, and a dedicated security pass covering the binary
download (checksum-verified, hardened against URL injection), archive
extraction, access control and output escaping.
Credits
Pagefind Search is a Drupal integration for the open-source
Pagefind engine by CloudCannon (MIT). The
Drupal module is licensed GPL-2.0-or-later.