From 0a99d81516175b23b3a4f328f9ae3fbc8b6079ee Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:09:50 +1300 Subject: [PATCH] Changelog + docs page improvements for ranking --- CHANGELOG.md | 24 ++++++++++++++++++++++++ docs/content/docs/ranking.md | 12 ++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ac1a8b..03d5dd00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,30 @@ ## Unreleased +### Core Features & Improvements +* Improved Pagefind's core result ranking algorithm to align with [BM25](https://en.wikipedia.org/wiki/Okapi_BM25). For existing sites, this will change the ordering of search results, and should provide better relevance for search results by default. +* Added the abitity to configure Pagefind's ranking algorithm. + * Certain categories of site (i.e. reference documentation) can benefit from tweaks to the way pages are ranked. To support this, a set of ranking parameters are now configurable. + * See [📘 Customize ranking](https://pagefind.app/docs/ranking/). + +### Default UI Features & Improvements +* Added an `autofocus` setting to the Default UI. The default remains off. See [📘 UI > Autofocus](https://pagefind.app/docs/ui/#autofocus). Thanks to @vanbroup for #514 ❤️ +* Added an `openFilters` setting to the Default UI. See [📘 UI > Open filters](https://pagefind.app/docs/ui/#open-filters). Thanks to @vanbroup for #579 ❤️ +* Added a `sort` setting to the Default UI. See [📘 UI > Sort](https://pagefind.app/docs/ui/#sort). +* Added a `triggerFilters` function to the Default UI. + * The existing `triggerSearch` function has also been documented. See [📘 UI > Programmatically controlling the Pagefind UI](https://pagefind.app/docs/ui-usage/#programmatically-controlling-the-pagefind-ui). + +### Fixes & Tweaks +* Fixed a bug where the `forceLanguage` setting would not take priority when using the NodeJS Indexing API. +* Fixed a bug where zero-width spaces in the source content could cause errors in search excerpts. + +### UI Translations +* Added Ukranian translations (PR #523 — thanks @vladdnepr !). +* Added Romanian translations (PR #541 — thanks @mateesville93 !). +* Added Czech translations (PR #543 — thanks @dallyh !). +* Added Korean translations (PR #583 — thanks @seokho-son !). +* Improved Japanese translations (PR #560 — thanks @hamano !). + ## v1.0.4 (November 16, 2023) ### Features & Improvements diff --git a/docs/content/docs/ranking.md b/docs/content/docs/ranking.md index 738f4d54..1cf62f6a 100644 --- a/docs/content/docs/ranking.md +++ b/docs/content/docs/ranking.md @@ -11,27 +11,31 @@ A good example is sites with a mix of long and short pages, where the long pages Ranking parameters are configured within the `ranking` option passed to Pagefind, which can optionally contain any or all of the available parameters. -## Configuring ranking parameters via the JavaScript API +## Configuring ranking parameters + +Ranking parameters can be passed to the JavaScript API via `pagefind.options()`: {{< diffcode >}} ```javascript const pagefind = await import("/pagefind/pagefind.js"); await pagefind.options({ + ranking: { -+ termFrequency: 1.0 ++ // optional parameters, e.g: ++ termFrequency: 1.0, + } }); ``` {{< /diffcode >}} -## Configuring ranking parameters via the Default UI +Ranking parameters can be passed to the Default UI during initialization: {{< diffcode >}} ```javascript new PagefindUI({ element: "#search", + ranking: { -+ termFrequency: 1.0 ++ // optional parameters, e.g: ++ pageLength: 0.75 + } }); ```