Skip to content

Commit ca4ec8b

Browse files
XREvoEmilien GUILMINEAU (Ext.)delucis
authored
fix: Search ranking on merge indexes (#2994)
Co-authored-by: Emilien GUILMINEAU (Ext.) <emilien.guilmineau.prestataire@sfr.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
1 parent 19282e8 commit ca4ec8b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/five-glasses-shout.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@astrojs/starlight": patch
3+
---
4+
5+
Fixes default ranking of merged indexes when using multi-site search

packages/starlight/schemas/pagefind.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ const pagefindIndexOptionsSchema = z.object({
6767
/**
6868
* Configure how search result rankings are calculated by Pagefind.
6969
*/
70-
ranking: pagefindRankingWeightsSchema.optional(),
70+
// We apply a default value to merged indexes in order to share the same ranking for them and the current site when not set explicitly.
71+
ranking: pagefindRankingWeightsSchema.default({}),
7172
});
7273

7374
const pagefindSchema = z.object({

0 commit comments

Comments
 (0)