fix: rank a console first for its own name

The PlayStation 2 page holds every word of "playstation bios" and pagefind ignores the words a page has that the query lacks, so its own body matches put it first. A console whose every word another system page's consoles also hold is now written again in an `exact` field (weight 20). File names reach the `files` field as their parts: whole names let "ds" reach twelve dsi_* names on the DSi page. `consoles` weighs 100 so an emulator named after its console (Saturn.emu) comes second, and `aliases` 10 so the Nintendo page keeps "gba bios". The gate runs both directions of the PlayStation, Game Boy, DS and Wii pairs and Saturn.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 06:54:08 +01:00
1 parent 6a611cd77a
commit 07f785cfd7
9 files changed
+191 -25

No files matched your search

+13
View File
@@ -70,6 +70,19 @@ QUERIES: dict[str, tuple[tuple[str, ...], int]] = {
"gamecube bios": (("systems/nintendo-gamecube/",), 1),
"game boy bios": (("systems/nintendo-game-boy/",), 1),
"3ds bios": (("systems/nintendo-3ds/",), 1),
# A console another one's name begins with, both ways: the longer name's
# page holds every word of the shorter query. GBA, GBC and the
# PlayStation 3 are sections of their maker's page; Saturn.emu is an
# emulator named after its console.
"playstation 2 bios": (("systems/sony-playstation-2/",), 1),
"playstation 3 bios": (("systems/sony/",), 1),
"game boy advance bios": (("systems/nintendo/",), 1),
"game boy color bios": (("systems/nintendo/",), 1),
"nintendo ds bios": (("systems/nintendo-nintendo-ds/",), 1),
"nintendo dsi bios": (("systems/nintendo-nintendo-dsi/",), 1),
"wii bios": (("systems/nintendo/",), 1),
"wii u bios": (("systems/nintendo-wii-u/",), 1),
"saturn bios": (("systems/sega-saturn/",), 1),
# The words an emulator prints, and the page that answers them.
"bios not found": (("wiki/troubleshooting/",), 3),
"please insert playstation cd-rom": (("wiki/troubleshooting/",), 3),