Add is_special to products sortableAttributes #6
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#6
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
Add
is_specialtosortableAttributesinshoppy-products.json, so the BFF'sspecials_firstcategory-listing sort (is_special:desc) is a valid Meilisearch sort.Background
Cross-repo dependency of
product-sync#11. The BFF (~/Projects/bff, ADR-0002) sorts category listings byis_special:desc, andproduct-syncemits that field into each product document. But Meilisearch'ssortableAttributesis an explicit allow-list, not "everything is sortable by default": a sort on an attribute absent from the list is rejected withHTTP 400 invalid_search_sort("Attributeis_specialis not sortable. Available sortable attributes are: ...").The products settings listed only
price.amountAsCents,price.comparativePricing.priceAsCents, andcategoryListingRank, so the BFF sort would 400 against any index built from these settings.Implementation Details
"is_special"tosortableAttributesinshoppy-products.json.README.mdto match.Notes / follow-ups
product-syncapplies these settings only when it creates an index, so an existing index keeps its oldsortableAttributesuntil the settings are re-applied out-of-band (PATCH /indexes/<index>/settings) — and the documents only carryis_specialafter a re-sync.product-syncis~/Projects/shoppy/indexes/shoppy-test.json(the shoppy monorepo copy), which still lacksis_special. Confirming that copy is superseded by this repo is tracked separately.Acceptance Criteria
shoppy-products.jsonlistsis_specialundersortableAttributes.README.mdsettings table matches.Test Plan
PATCH /indexes/<index>/settingswithshoppy-products.json, thenGET /indexes/<index>/settings/sortable-attributesincludesis_special.sort: ["is_special:desc"]returns200and orders2→1→0.is_specialmissing from sortable-attributes — breaks BFF category browse (400 invalid_search_sort) #9