Skip to content

Commit

Permalink
Changelog + docs page improvements for ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Apr 2, 2024
1 parent 2a66612 commit 0a99d81
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions docs/content/docs/ranking.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
+ }
});
```
Expand Down

0 comments on commit 0a99d81

Please sign in to comment.