Search — help & reference

The Search plugin adds on-site search to your site: an embeddable, query-aware search box (a content widget) backed by a pluggable engine. The built-in engine searches the titles, descriptions and text of your published pages and content (entries other plugins publish, …) and needs no setup — search works the moment the plugin is installed and enabled. A change you make in the console (a page saved, an entry published, a setting changed) is searchable at once.

Install a ready-made search results page

On the Search settings page, the Search page card installs a ready-made results page (at /search) carrying the box. It then becomes an ordinary site page — it appears under Pages, and you can edit its template, restyle it, move it or give it a different URL. Installing never overwrites an existing page, and it follows your site's editorial rules: on a site whose pages need review, the page waits in the review queue; when the quality checks block publishing, it is created as a draft for you to fix in the page editor. The button tells you which happened.

Or put a search box on any page

In any page (or your master chrome), add an anchor where the box should appear:

<div id="site-search" data-widget="search/box"></div>

The id and data-widget must be on the same element. The box submits ?q= to your results page (the Results page path setting, default /search). The widget is query-aware: when a page carrying it is opened with a non-blank q, it renders the ranked results inline below the box. Everything is styled by this plugin's stylesheet (/__plugin/search/static/search.css) — override any .rw-search* rule from your own CSS to match your theme.

Settings (per site)

Searches with no results

Turn on Record searches with no results and the settings page lists what visitors searched for on your site and did not find — most frequent first, with how often and when it was last searched. Each entry is a hint: a page you could add, a title or description that should mention the word visitors use, or a redirect from an old name.

It is off by default because a search term is whatever a visitor typed, and people sometimes type names, email addresses or numbers. When it is on, only the term, a count and the last time are kept — never an IP address, a user or a session. Terms that look like an email address or a phone number are not kept at all. Letter case and extra spaces are ignored, so "Opening  Hours" and "opening hours" count together. The list keeps at most 500 terms (the rarest make room for new ones) and forgets a term nobody has searched for in the number of days you set. Clear list forgets everything at once; it cannot be undone. If you turn recording off, the list stays until you clear it or its terms age out.

The list is kept in your site's folder, so a full backup carries it. A transfer copy of the site (the download meant for someone outside your organisation) leaves it out, because it is what visitors typed.

Rebuild the index

Search notices every change made through the console by itself. If files were changed some other way (copied in by hand), Rebuild index on the Search settings page re-reads everything now and tells you how many items the index holds.

A better engine

Search is backed by a SiteSearchEngine extension point. Installing a companion plugin such as search-lucene (which builds a full-text index over your page bodies) transparently upgrades the engine — the box and the inline results are unchanged. The Active engine line on the Search settings page shows which engine is serving your site.