Products index v10: is_special missing from sortable-attributes — breaks BFF category browse (400 invalid_search_sort) #9
Labels
No labels
bug
chore
documentation
enhancement
feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
shoppy/shoppy-index-configuration#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The fresh products index
shoppy-test-v10(created 2026-09-20, after #3 landed theattributeranking-rule change) does not declareis_specialas a sortable attribute. The Shoppy BFF's default CATEGORY sort isspecials_first=["is_special:desc", "categoryListingRank:asc"], so every real-category browse through the BFF fails with 400 against v10.This blocks pointing the BFF at v10 (the index that carries the search-relevance fix from #3 / bff#13).
Evidence (2026-09-20, via Kong gateway)
Same request body against both indexes:
shoppy-test-v9→ 200 (works)shoppy-test-v10→ 400:Document-level check: v10 documents do carry the field (
is_special: 0observed on a fetched hit), while v9 documents don't carry it at all (yet v9's settings declared it sortable, so the sort was a no-op primary key there). So between the v9 and v10 runs both the data (field added) and the effective settings (sortable declaration dropped) changed.BFF impact
productList(listType: CATEGORY)for any real category → 400 (Error getting products by category). Default sort isspecials_first(to_ms_sort_option,src/graphql/queries/helpers.rsin shoppy/bff); the explicit-sort passthrough can also request it.price.tagsand sort by price only.categoryListingRank/price.amountAsCents, both still sortable).Fix
Add
is_specialback to the products index settings'sortableAttributesin this repo's template(s) — wherever v10's settings came from (shoppy-products.jsonand/or the live templateshoppy-indexes/shoppy-test.jsonconsumed byproduct-syncviaMEILISEARCH_INDEX_CONFIG_PRODUCTS). Check why it was dropped between the v9 and v10 runs so it doesn't recur.Apply to the live
shoppy-test-v10without waiting for a fresh run — the Kong gateway allows thesortable-attributessettings sub-route:(Preserve the existing three entries; confirm final state via
GET .../settings/sortable-attributes.)Validation
POST /indexes/shoppy-test-v10/searchwithsort: ["is_special:desc","categoryListingRank:asc"]and a category filter → 200.productList(listType: CATEGORY, argument: "fruit")withshoppy-stores: woolworthsreturns products (specials first).Note on behaviour change
On v9 the
is_specialsort was inert (no document carried the field — all ties fell through tocategoryListingRank). Once v10 sorts by a realis_specialvalue, category browse will genuinely put specials at the top — which is the intended semantics of thespecials_firstdefault, but it is a visible UX change worth calling out when the BFF switches indexes.Closing as resolved — the blocker is gone, and the "apply to v10" step is obsolete rather than outstanding.
Repo side (already done)
shoppy-products.jsonlistsis_specialundersortableAttributes(line 22) and the README settings table matches (README.md:35). Landed in7680977— issue-6: add is_special to products sortableAttributes (#7) — which closed #6. Nothing further is required in this repo.Live instance (verified 2026-09-22 ~11:20Z)
sortableAttributessort: ["is_special:desc", ...]shoppy-test-v9is_specialshoppy-test-v10invalid_search_sort(unchanged, as reported)shoppy-test-v11is_specialThe settings fix landed on
shoppy-test-v11as Meilisearch task 1544 (settingsUpdate, succeeded2026-09-22T11:19:46Z). Confirmed live:Documents carry the field too — a 1000-hit sample of the 48,763 docs had 0 missing
is_special(976 ×0, 24 ×1), so the sort is meaningful rather than a no-op tie-break.Validation
POST /indexes/shoppy-test-v11/searchwithsort: ["is_special:desc","categoryListingRank:asc"]and a category filter → 200.search__products_index=shoppy-test-v11)productList(listType: CATEGORY, argument: "fruit", pageNumber: 1)withshoppy-stores: woolworths→ 200,totalItems: 50, items returned. The defaultspecials_firstsort no longer 400s.is_specialsort.Not fixed by this closure
shoppy-test-v10still lacksis_specialand will keep returning 400 onspecials_first. It is superseded and unreferenced — delete it or leave it alone, but do not point anything at it.2026-09-22T05:29Z) is exactly the canonicalshoppy-products.jsonas of the pre-#7 state (df465b3:attributerule present, only three sortables). It matches neither~/Projects/shoppy-indexes/shoppy-test.jsonnor the retired~/Projects/shoppy/indexes/shoppy-test.json(both also lack theattributerule), so a stale settings source (old copy/checkout or binary) produced those runs. v11 was corrected out-of-band rather than by re-creating the index — the next fresh index run could regress the same way unless that source is tracked down.Follow-ups for the open half are tracked in product-sync: #12 (re-sync so
is_specialexists on every document), #13 (validate present + sortable), #16 (one-off settings PATCH).