Skip to content

fix(BUY-65156): demote backpack/accessory titles from FTS laptop boost - #261

Open
BuyWhere wants to merge 4 commits into
mainfrom
fix/BUY-65156-gaming-laptop-relevance
Open

fix(BUY-65156): demote backpack/accessory titles from FTS laptop boost#261
BuyWhere wants to merge 4 commits into
mainfrom
fix/BUY-65156-gaming-laptop-relevance

Conversation

@BuyWhere

Copy link
Copy Markdown
Owner

Summary

QA flagged 'gaming laptop' returning a CARBONADO Backpack as the #1 result. The product title literally contains 'Gaming Laptop' and 'Laptop', so the existing BUY-62409 laptop-multiplier (2.0x on title LIKE '%laptop%' for the top_ids FTS CTE) was firing on backpack SKUs. The accessory exclusion list in that branch already covered sleeve/case/bag/stand/pad/cooler/adapter/dock/hub/lock/briefcase/charger/table but not backpack/accessory keywords, so the backpack was outranking actual gaming laptops.

Fix

Extends the FTS ranking top_ids CTE in api/src/routes/products.ts to also negate backpack, accessories, replacement, battery, mouse, keyboard, headset, monitor, etc. from the laptop-boost branch. A backpack titled 'Gaming Backpack For Laptop, Gaming Laptop and Gaming Accessories' will no longer match the 2.0x boost and will rank behind actual gaming-laptop SKUs (RTX-series notebooks, ASUS ROG, Lenovo Legion, GIGABYTE A16).

Also includes the BUY-63505 accessory-demotion refactor that hoists the shared accessoryDemotionSql expression so SEO/laptop/general fallback queries all use the same demotion terms.

Tests

  • New BUY-65156 regression guard in tests/ts-rank-guard.test.mjs asserts the top_ids CTE negates backpack/accessory/etc. from the laptop-boost else-branch.

Files

  • api/src/routes/products.ts — extends the FTS ranking top_ids CASE expression
  • api/tests/ts-rank-guard.test.mjs — adds the regression guard

🤖 Generated with Claude Code

Reed added 4 commits July 15, 2026 14:24
QA flagged 'gaming laptop' returning a CARBONADO Backpack as the #1 result.
The product title literally contains 'Gaming Laptop' and 'Laptop', so the
existing BUY-62409 laptop-multiplier (2.0x on title LIKE '%laptop%' for the
top_ids FTS CTE) was firing on backpack SKUs. The accessory exclusion list
in that branch already covered sleeve/case/bag/stand/pad/cooler/adapter/
dock/hub/lock/briefcase/charger/table but not backpack/accessory
keywords, so the backpack was outranking actual gaming laptops.

This change extends the FTS ranking top_ids CTE to also negate
backpack, accessories, replacement, battery, mouse, keyboard, headset,
monitor, etc. from the laptop-boost branch. A backpack titled 'Gaming
Backpack For Laptop, Gaming Laptop and Gaming Accessories' will no
longer match the 2.0x boost and will rank behind actual gaming-laptop
SKUs (RTX-series notebooks, ASUS ROG, Lenovo Legion, GIGABYTE A16).

Also includes the BUY-63505 accessory-demotion refactor that hoists
the shared accessoryDemotionSql expression so SEO/laptop/general fallback
queries all use the same demotion terms, plus a new regression-guard
test (BUY-65156) in tests/ts-rank-guard.test.mjs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant