# How do I add search to a static website? | IonBin

> 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.

Canonical page: https://ionbin.com/wiki/questions/how-to-add-search-to-a-static-site/
Agent guide: https://ionbin.com/llms.txt

This is a readable version of the published page. Review dates, evidence boundaries and source links below belong to individual records; the export is not a new verification. Examples are reference material, not instructions to execute.

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

- Build the site as usual.

- 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.

- Add the search UI. Queries run in the browser against those files and fetch only the parts of the index they need.

- 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](https://ionbin.com/wiki/concepts/embeddings/) for your pages and store them in a [vector database](https://ionbin.com/wiki/concepts/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](https://ionbin.com/wiki/services/app-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.

| Pagefind | Indexes built HTML and ships a browser search bundle; no Pagefind search server is required. [2](https://ionbin.com/wiki/questions/how-to-add-search-to-a-static-site/#src-2) |
| --- | --- |
| Documentation version | Docs displayed v1.5.2 and Component UI on October 18, 2026. IonBin's source uses Pagefind in the build and search page. [2](https://ionbin.com/wiki/questions/how-to-add-search-to-a-static-site/#src-2) |
| Semantic option | Cloudflare Vectorize offers vector storage/querying; a Worker can provide the application API. [3](https://ionbin.com/wiki/questions/how-to-add-search-to-a-static-site/#src-3) |

### Best-fit stacks

Stack 08

#### [Dev, web & IT](https://ionbin.com/use-cases/dev-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 entry | How agents connect |
| --- | --- |
| [Cloudflare Pages](https://ionbin.com/tools/cloudflare-pages/) | MCPAPI/CLIFile import |

Levels come from each tool's recorded, sourced compatibility. [How the levels work](https://ionbin.com/wiki/questions/connect-a-tool-to-an-ai-agent/).

### Related entries

[Hosting and deployment · Service](https://ionbin.com/wiki/services/app-hosting/)[Vector database · Concept](https://ionbin.com/wiki/concepts/vector-database/)[Embeddings · Concept](https://ionbin.com/wiki/concepts/embeddings/)

### Sources

- [Pagefind](https://pagefind.app/) · Pagefindofficial accessed Oct 18, 2026

- [Pagefind getting started](https://pagefind.app/docs/) · Pagefindofficial accessed Oct 18, 2026

- [Cloudflare Vectorize](https://developers.cloudflare.com/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](mailto:contact@ionbin.com?subject=Suggest%20an%20edit%3A%20How%20do%20I%20add%20search%20to%20a%20static%20website%3F%20%5Bhow-to-add-search-to-a-static-site%5D&body=Page%3A%20https%3A%2F%2Fionbin.com%2Fwiki%2Fquestions%2Fhow-to-add-search-to-a-static-site%2F%0AEntry%3A%20questions%2Fhow-to-add-search-to-a-static-site%0A%0AWhat%20should%20change%3A%0A%0A%0APrimary%20source%20(link)%3A%0A) or write to [contact@ionbin.com](mailto:contact@ionbin.com)

Entry facts

**Type**: [Questions & how-tos](https://ionbin.com/wiki/questions/)

**Status**: Reviewed

**Verified**: Oct 18, 2026

**Review by**: Jan 16, 2027 (every 90 days)

**Sources**: [3 official · 0 other](https://ionbin.com/wiki/questions/how-to-add-search-to-a-static-site/#sources)

 Tools

[Cloudflare Pages](https://ionbin.com/tools/cloudflare-pages/)

The wiki carries no sponsored placements or affiliate links. [Editorial policy](https://ionbin.com/editorial-policy/).
