From 5229a4902b48079a505fe8f318dff61a8acf2277 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 4 May 2024 13:09:11 -0700 Subject: [PATCH] Update search.ts --- apps/api/src/controllers/search.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/api/src/controllers/search.ts b/apps/api/src/controllers/search.ts index 41270cb..010af42 100644 --- a/apps/api/src/controllers/search.ts +++ b/apps/api/src/controllers/search.ts @@ -54,10 +54,12 @@ export async function searchHelper( // filter out social media links + console.log("Search results", searchOptions.limit); + const a = new WebScraperDataProvider(); await a.setOptions({ mode: "single_urls", - urls: res.map((r) => r.url), + urls: res.map((r) => r.url).slice(0, searchOptions.limit ?? 7), crawlerOptions: { ...crawlerOptions, }, @@ -69,7 +71,7 @@ export async function searchHelper( }, }); - const docs = await a.getDocuments(true); + const docs = await a.getDocuments(false); if (docs.length === 0) { return { success: true, error: "No search results found", returnCode: 200 }; }