From 19eeaf15881571c2b1c8afc67fe15b808499a33b Mon Sep 17 00:00:00 2001 From: Malin Date: Wed, 6 May 2026 09:10:48 +0200 Subject: [PATCH] fix: 'Not checked' routes to DuckDB, not SQLite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prescreen_status='none' was truthy so it triggered /api/enriched, which only finds rows already in enriched_domains with NULL status — missing all the unprocessed domains that only exist in the 72M DuckDB index. - exclude 'none' from the hasEnrichFilter check - 'Not checked' now uses /api/domains (DuckDB) and filters client-side: rows where prescreen_status is absent = never touched - all other prescreen status values (live/dead/parked/error) still use /api/enriched server-side Co-Authored-By: Claude Sonnet 4.6 --- app/static/beauty/index.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/static/beauty/index.html b/app/static/beauty/index.html index ab481d9..89e760d 100644 --- a/app/static/beauty/index.html +++ b/app/static/beauty/index.html @@ -493,23 +493,29 @@ function app() { if (this.f.alpha_only) p.set('alpha_only', 'true'); if (this.f.no_sld) p.set('no_sld', 'true'); - const hasEnrichFilter = this.f.prescreen_status || this.f.niche || this.f.site_type || this.f.country; + // 'none' (Not checked) = domains never in the pipeline → must search DuckDB. + // Any other enrichment filter (live/dead/parked, niche, site_type, country) + // requires the SQLite enriched_domains table. + const hasEnrichFilter = (this.f.prescreen_status && this.f.prescreen_status !== 'none') + || this.f.niche || this.f.site_type || this.f.country; let endpoint; if (hasEnrichFilter) { - // Enrichment filters require the SQLite table — add them server-side if (this.f.prescreen_status) p.set('prescreen_status', this.f.prescreen_status); if (this.f.niche) p.set('niche', this.f.niche); if (this.f.site_type) p.set('site_type', this.f.site_type); if (this.f.country) p.set('country', this.f.country.trim().toUpperCase()); endpoint = '/api/enriched'; } else { - // Discovery mode: search full 72M DuckDB index (e.g. "Not checked" keyword search) endpoint = '/api/domains'; } const d = await fetch(endpoint + '?' + p).then(r=>r.json()); this.domainsTotal = d.total || 0; - this.domains = d.results || []; + let rows = d.results || []; + // 'Not checked': DuckDB returns all domains joined with enriched data; + // filter client-side to keep only those with no prescreen_status yet. + if (this.f.prescreen_status === 'none') rows = rows.filter(r => !r.prescreen_status); + this.domains = rows; } catch(e) { this.notify('Failed to load: '+e.message, 'error'); } finally { this.loading = false; } },