The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Remove query filtering log matching max limit
Rafi123b3f042f2c
diff --git a/apps/web/lib/api/partners/search/find-candidates.ts b/apps/web/lib/api/partners/search/find-candidates.tsindex d2413a7e0a..10ae038865 100644--- a/apps/web/lib/api/partners/search/find-candidates.ts+++ b/apps/web/lib/api/partners/search/find-candidates.ts@@ -24,19 +24,7 @@ export async function findPartnerSearchCandidates({ throwOnError = false }: FindPartnerSearchCandidatesOptions = {},): Promise<PartnerSearchResult | null> {try {- const result = await searchProvider.searchCandidates(query);-- // A full page means the provider had more to give, so every count built- // from these candidates is a floor rather than a total, and any filter the- // database applies is choosing from a truncated set. Logged because there- // is nowhere in the response to say so without changing its shape.- if (result.hits.length >= query.limit) {- console.warn(- `[Partner Search] Query "${query.query}" filled the ${query.limit} candidate ceiling for program ${query.programId}. Results and counts are a floor, not a total.`,- );- }-- return result;+ return await searchProvider.searchCandidates(query);} catch (error) {if (throwOnError) {throw error;diff --git a/apps/web/lib/api/partners/search/types.ts b/apps/web/lib/api/partners/search/types.tsindex 625c12e657..e97190579c 100644--- a/apps/web/lib/api/partners/search/types.ts+++ b/apps/web/lib/api/partners/search/types.ts@@ -12,8 +12,8 @@ import { PlatformType } from "@prisma/client";* 2. the database applies status/group/country/tag/metric to those 999** A query matching fewer than 999 is unaffected. Beyond that, both the rows and- * the count are a floor. There is no field on the list or count response to say- * so without breaking their shape, so findPartnerSearchCandidates logs it.+ * the count are a floor, and nothing reports that — neither response has a+ * field for it that could be added without breaking its shape.** The fix is indexing the filterable fields so the provider filters before it* ranks, which means keeping them in sync on every write — out of scope here.