Explanation

How ranking works

Results are scored with BM25 over the record text, with extra weight for two fields:

  • the record’s own heading, weighted heavily

  • the title of the page it belongs to, weighted lightly

These are kept separate because every section of a page shares that page’s title. If both were weighted heavily, searching for a page title would rank its subsections alongside the page itself, often above it.

The last word of the query is matched as a prefix as well as exactly, since you are probably still typing it. That way install also finds installation. Results must match every query word that appears in the index, so adding words narrows the results. Words that appear nowhere in the index are ignored.

How the dialog picks its colors

The dialog reads the page’s background and text colors and copies them onto itself. It watches for changes, so it follows the theme’s light and dark toggle. Most themes switch modes with a class or attribute, which prefers-color-scheme does not detect.