feat(docsearch): display 5 hits per category maximum
This commit is contained in:
parent
9eaf18a81f
commit
e5896579be
1 changed files with 5 additions and 1 deletions
|
|
@ -9,7 +9,11 @@ export function groupBy<TValue extends object>(
|
|||
acc[key] = [];
|
||||
}
|
||||
|
||||
acc[key].push(item);
|
||||
// We limit each section to show 5 hits maximum.
|
||||
// This acts as a frontend alternative to `distinct`.
|
||||
if (acc[key].length < 5) {
|
||||
acc[key].push(item);
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
Loading…
Reference in a new issue