Set up Fuse JS

What you need: Simply Static Pro

Fuse.js is a lightweight search that runs entirely in the visitor's browser, using a small index file Simply Static builds during a push. It's the easiest way to add search to a static site, with no external service to sign up for. (The other search type, Algolia, is an external API service instead.)

Enable search

Go to Simply Static > Search and turn on Use search. Then set Search Type to Fuse JS.

A few options control how the search UI looks and behaves:

  • Use Search Results Page: when on, Simply Static creates a static search results page and includes a special __qs  directory in the export.
  • Use Submit Button: show or hide the submit button in the search UI.
  • Submit Button Text: customize the button label, or use HTML to add something like an icon.
  • Show excerpt in suggestions/results: display a short excerpt beneath each suggestion and result item.
  • Input Placeholder: the placeholder text shown inside the search box.

Indexing

The Indexing section controls what Simply Static reads from each page and shows in the results. It uses CSS selectors to pull out the title, content, and excerpt.

  • CSS-selector for title: defaults to title .
  • CSS-selector for content: defaults to body .
  • CSS-selector for excerpt: defaults to .entry-content .

You can point these at any HTML element on your pages, or use meta tags instead (each field links to more information in the interface).

  • Exclude URLs: keep certain pages out of the index. Enter one per line. You can use full URLs, parts of a URL, or plain words (handy as stop words), for example author , archive , or category .

Fuse.js settings

The Fuse.js section fine-tunes how matching works.

Connect your search box

  • CSS-selector: the selector for the <form>  element that contains your search input. Simply Static converts your existing search box into a static search input. If you have multiple search elements with different selectors, separate them with commas, such as .search-form, .custom-search-form .

To find the selector, open your site in a browser, right-click your search box, and choose Inspect. Find the <form>  element wrapping the input and use its ID (like #wp-block-search__input-2 ) or class.

Threshold

  • Threshold: controls how strict matching is. A value of 0.0  requires a perfect match, while 1.0  matches almost anything. Lower values are stricter, so something like 0.2  keeps results tight.

Extended search and location

  • Use Extended Search: enables Fuse.js operators such as exact match, prefix, suffix, and inverse match.
  • Ignore Location: when on, a match can occur anywhere in the text. By default, Fuse.js favors matches near the start of a string.

Weight

Weighting lets you prioritize certain fields. A higher weight pushes results that match that field further up the list, and the default is 1 .

  • Title weight
  • Content weight
  • Excerpt weight

For example, a high content weight makes matches in the page body count for more than matches in the title or excerpt.

Build the index

Click Save Settings, then run a Push. Simply Static builds the search index and includes it in your static site, so search is ready as soon as the push finishes.