Jump to content

Searching

From Wikven

Static sites have no server to answer queries, so MediaWiki's built-in search does not work in the export. Wikven ships SifterSearch built in and enabled by default: it builds a static search index at build time and serves results entirely in the browser, so every site has working search with no setup. This documentation site uses it.

How it works

SifterSearch indexes the rendered pages with Pagefind and writes a static index bundle into the build output. On each page it feeds those results into the skin's own search box (Vector 2022's typeahead, or the classic suggestions box on other skins), so search runs with no API, database, or load.php behind it.

Configuring it

Search needs no configuration: the index is written to a pagefind/ directory under the build output and served from /pagefind/. You only adjust it in a few cases, all in .wikven.yaml.

If your site lives in a subdirectory, set the bundle path to include it. This site deploys under /wikven on GitHub Pages:

config:
  SifterSearchBundlePath: /wikven/pagefind/

To list all matches on a page rather than just the typeahead, name a content page (see below):

config:
  SifterSearchResultsPage: "Search"

To turn search off, point the output directory at nothing:

config:
  SifterSearchOutputDir: ""

Full results page

The skin's search box shows the top matches as you type. For a page that lists all matches, create an (otherwise empty) content page and name it in SifterSearchResultsPage. SifterSearch mounts its full search UI there and runs the query from the URL, and the search box's "search for pages containing…" action and its Enter key go to that page. This site uses a page titled Search.


Retrieved from "Searching.html"