[object Object]

← back to Dw Photo Capture

auto-save: 2026-07-13T00:51:43 (2 files) — visual-search/__pycache__/search_service.cpython-312.pyc visual-search/search_service.py

95931a97d79d28b5d0abcc165de2c14ad4d0e70d · 2026-07-13 00:51:44 -0700 · Steve Abrams

Files touched

Diff

commit 95931a97d79d28b5d0abcc165de2c14ad4d0e70d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jul 13 00:51:44 2026 -0700

    auto-save: 2026-07-13T00:51:43 (2 files) — visual-search/__pycache__/search_service.cpython-312.pyc visual-search/search_service.py
---
 .../__pycache__/search_service.cpython-312.pyc      | Bin 20126 -> 20305 bytes
 visual-search/search_service.py                     |   4 ++++
 2 files changed, 4 insertions(+)

diff --git a/visual-search/__pycache__/search_service.cpython-312.pyc b/visual-search/__pycache__/search_service.cpython-312.pyc
index 813318a..69aec93 100644
Binary files a/visual-search/__pycache__/search_service.cpython-312.pyc and b/visual-search/__pycache__/search_service.cpython-312.pyc differ
diff --git a/visual-search/search_service.py b/visual-search/search_service.py
index 9f7df9b..7e1493c 100644
--- a/visual-search/search_service.py
+++ b/visual-search/search_service.py
@@ -94,11 +94,15 @@ def load():
     # LEFT JOIN vendor_catalog for the color/style re-rank signals (dominant_color_hex + ai_styles),
     # and shopify_products for the storefront `handle` so /similar can return a real PDP link.
     # Keyed by dw_sku; rows without a match just carry null fam/styles/handle (soft signals, never required).
+    # handle joins ONLY to ACTIVE + Online-Store-published products: /similar's DW-safe
+    # guard drops handleless rows, so archived/draft/unpublished products can never be
+    # suggested as clickable results (their vectors still serve as query anchors).
     cur.execute("""select e.vc_id, e.dw_sku, e.mfr_sku, e.vendor_code, e.pattern_name, e.image_url,
                           e.embedding, v.dominant_color_hex, v.ai_styles, sp.handle
                    from image_embeddings e
                    left join vendor_catalog v on v.dw_sku = e.dw_sku
                    left join shopify_products sp on sp.dw_sku = e.dw_sku
+                        and sp.status = 'ACTIVE' and sp.online_store_published is true
                    where e.embedding is not null""")
     vecs, meta, fam, styles, sku_ix = [], [], [], [], {}
     for vc_id, dw_sku, mfr, vc, pat, url, emb, hexc, ai_styles, handle in cur:

← a0e586b visual-search: make bind host configurable via VS_HOST (defa  ·  back to Dw Photo Capture  ·  visual-search: bind VS_HOST=0.0.0.0 so Kamatera pairs-well c fcb1edb →