Independent reviews. IonBin has no partnerships with the tools on this page and was not paid for these listings. Our evaluations are our own, based on public documentation and our research. Product names are trademarks of their owners and are used for identification only. How disclosure works.

Question

How do I add search to a static website?

Verified Oct 17, 2026 Review by Jan 15, 2027 4 sources
Short answer

Use a static search library that builds an index when the site is built and runs in the visitor's browser, with no server to manage. Pagefind is one such tool and powers IonBin's own search. For semantic or AI-powered search, add embeddings and a vector index, such as Cloudflare Vectorize, behind a small API.

What it is

Static sites, which are built ahead of time and served as files, have no database to query, so search needs a different approach. A static search library indexes the built pages and runs the search in the visitor’s browser.

How it works

  1. Build the site as usual.
  2. Run the search indexer over the output. Pagefind writes its index files alongside the pages and works with any static site generator, as long as the built HTML contains the content.
  3. Add the search UI. Queries run in the browser against those files and fetch only the parts of the index they need.
  4. Mark which content to index or ignore, and add filters such as type or category.

Current tooling (checked 2026-10-17). Pagefind is at version 1.5.2 and offers a newer Component UI alongside its original search UI. For meaning-based search, generate embeddings for your pages and store them in a vector database such as Cloudflare Vectorize, queried through a small Worker.

Benefits

  • No servers or per-query fees for keyword search.
  • Fast and private: queries stay in the browser.
  • Works on any static host (see hosting).

Limits and risks

  • Index size grows with the site, though Pagefind is designed to download only what each search needs.
  • Keyword only by default. Synonyms and meaning-based matches need a semantic layer, which adds a server-side component and cost.
  • Rebuild to update. Indexing must run on every build, or search shows stale results.

Checked specs

Snapshot from official sources on Oct 17, 2026.

PagefindFully static search library; works with any static HTML output; no hosted infrastructure [1]
Current version (checked 2026-10-17)Pagefind v1.5.2, with a newer Component UI alongside the original UI [1]
Semantic optionCloudflare Vectorize, a vector database for embeddings, called from Workers [4]

Best-fit stacks

Stack 08

Dev, web & IT

Design, code, host and ship sites and internal tools, with an AI editor doing most of the typing.

Agent compatibility

Tool in this entryHow agents connect
Cloudflare Pages MCPAPI/CLIBulk import

Levels come from each tool's recorded, sourced compatibility. How the levels work.

Sources

  1. Pagefind · Pagefindofficial accessed Oct 17, 2026
  2. Pagefind documentation · Pagefindofficial accessed Oct 17, 2026
  3. Cloudflare Pages docs · Cloudflareofficial accessed Oct 17, 2026
  4. Vectorize docs · Cloudflareofficial accessed Oct 17, 2026

Practitioner views are restated in our words and labeled as views, not measured results. Product facts come from official sources dated above.

Suggest an edit

IonBin's wiki isn't user-edited. Corrections go to our Directory Curator, who checks them against primary sources before anything changes. Spot something wrong or out of date on “How do I add search to a static website?”? Email us with a link to a primary source.

Suggest an edit by email or write to [email protected]