StaticSearch v0.6.0 update

By Craig Buckler

462 words, 3-minute read

search
Image courtesy of Agence Olloweb

StaticSearch v0.6.0 was released on . There should be no breaking changes but there are a few new features and results ordering may change.

Improved results ordering #

The latest update:

  1. orders results from highest to lowest relevancy as before.

  2. If those values match, it orders results from highest to lowest found value (a number between 0 and 1 that indicates the proportion of search words found in a page).

  3. If those values match, it orders results from newest to oldest date.

Highlight search words #

Setting a highlight attribute on the web component or bind module scrolls to and highlights the first matching search terms on a results page.

This uses text fragment links which can have issues:

  1. searching for “highlight” will return pages containing “highlighted” and “highlighter”, but they are not highlighted.

  2. A highlighted word could appear outside your main content, such as in a menu.

Selected search text #

When using the <static-search> web component, activating search now selects the current search term as well as focusing the field. This allows quicker searches for a new term.

Additional language support #

StaticSearch removes commonly-used stop words considered insignificant to the meaning of text – such as “and”, “the”, and “but” in English. This can produce better results and v0.6.0 now supports stop words in:

Smaller payload #

Thanks to an esbuild update, the minified JavaScript has reduced by a couple of kilobytes to less than 11Kb – despite having more code!

Get started #

The StaticSearch documentation provides a quick start guide, and details about the indexer, web component, bind module, and JavaScript API.

StaticSearch works well with Publican sites. The Publican documentation provides a quick start guide, a detailed set-up guide, API references, and common recipes you can use and adapt for your own projects.