IonBin
All pages
Search
Question

How do I add search to a static website?

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.

Verified Oct 18, 2026 Review by Jan 16, 2027 3 sources

What it is

A purely static site serves prebuilt files. It can use a browser search index or call a separate search service. 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-18). 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 Pagefind search server or Pagefind per-query charge; hosting and bandwidth still follow your provider’s terms.
  • Query matching runs in the browser. Your own analytics, custom integrations and host logging can affect privacy; do not promise that the entire site collects no search-related data.
  • 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.
  • Different search needs. Keyword search does not provide general semantic retrieval. Synonym handling can also be implemented with query/index customization; it does not inherently require a vector service.
  • Rebuild to update. Generate and deploy the index with the matching page build. Test known queries and excluded pages before release.
  • The index is published data. Excluding a page from navigation is not access control. Do not include confidential content in a publicly downloadable search index.

Checked specs

Snapshot from official sources on Oct 18, 2026.

PagefindIndexes built HTML and ships a browser search bundle; no Pagefind search server is required. [2]
Documentation versionDocs displayed v1.5.2 and Component UI on October 18, 2026. IonBin's source uses Pagefind in the build and search page. [2]
Semantic optionCloudflare Vectorize offers vector storage/querying; a Worker can provide the application API. [3]

Best-fit stacks

Stack 08

Dev, web & IT

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

Agent compatibility

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

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

Sources

  1. Pagefind · Pagefindofficial accessed Oct 18, 2026
  2. Pagefind getting started · Pagefindofficial accessed Oct 18, 2026
  3. Cloudflare Vectorize · Cloudflareofficial accessed Oct 18, 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 contact@ionbin.com