Skip to content

Commit d0cb659

Browse files
committed
feat: increase default limit for search results from 20 to 100
1 parent 9cea757 commit d0cb659

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/search-manager/data/api.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,29 +310,28 @@ export async function fetchSearchResults({
310310
};
311311
}
312312

313-
/* eslint-disable no-await-in-loop */
314313
export async function fetchAllSearchResults(
315314
params: FetchSearchParams,
316315
): Promise<{
317-
hits: HitType[];
318-
totalHits: number;
319-
blockTypes: Record<string, number>;
320-
problemTypes: Record<string, number>;
321-
publishStatus: Record<string, number>;
322-
}> {
316+
hits: HitType[];
317+
totalHits: number;
318+
blockTypes: Record<string, number>;
319+
problemTypes: Record<string, number>;
320+
publishStatus: Record<string, number>;
321+
}> {
323322
const allHits: HitType[] = [];
324-
const limit = params.limit ?? 20;
323+
const limit = params.limit ?? 100;
325324

326325
let offset = 0;
327326
let nextOffset: number | undefined;
328327

329-
// Facets + totals only need to be read once (from the first page)
330328
let totalHits = 0;
331329
let blockTypes: Record<string, number> = {};
332330
let problemTypes: Record<string, number> = {};
333331
let publishStatus: Record<string, number> = {};
334332

335333
do {
334+
// eslint-disable-next-line no-await-in-loop
336335
const page = await fetchSearchResults({
337336
...params,
338337
offset,
@@ -360,7 +359,6 @@ export async function fetchAllSearchResults(
360359
publishStatus,
361360
};
362361
}
363-
/* eslint-enable no-await-in-loop */
364362

365363
/**
366364
* Fetch the block types facet distribution for the search results.

0 commit comments

Comments
 (0)