Update search.ts

This commit is contained in:
Nicolas 2024-08-12 16:51:43 -04:00
parent 98be29c963
commit 6810338271

View File

@ -80,7 +80,7 @@ export async function searchHelper(
await a.setOptions({
jobId,
mode: "single_urls",
urls: res.map((r) => r.url).slice(0, searchOptions.limit ?? 7),
urls: res.map((r) => r.url).slice(0, Math.min(searchOptions.limit ?? 5, 5)),
crawlerOptions: {
...crawlerOptions,
},
@ -150,7 +150,8 @@ export async function searchController(req: Request, res: Response) {
};
const origin = req.body.origin ?? "api";
const searchOptions = req.body.searchOptions ?? { limit: 7 };
const searchOptions = req.body.searchOptions ?? { limit: 5 };
const jobId = uuidv4();