Skip to content

fix: order[...] filter ignored reference/name.<lang>, mishandled multi-field priority - #72

Open
gjuillot wants to merge 2 commits into
Altered-Community:mainfrom
gjuillot:fix/card-order-filter
Open

gjuillot wants to merge 2 commits into
Altered-Community:mainfrom
gjuillot:fix/card-order-filter

Conversation

@gjuillot

@gjuillot gjuillot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Consolidate the three separate order filters (OrderFilter, SetDateOrderFilter, CardGroupOrderFilter) into a single CardOrderFilter that processes order[...] params in the order the client sent them, instead of filter-registration order. Also adds support for order[reference] and order[name.], previously silently ignored.

Remaining work / known limitations

1. Ops step required after deploy. The live Meilisearch index needs app:meilisearch:index --configure re-run to pick up the new sortableAttributes (reference, name_fr, name_en). Until that runs, requests using order[reference] or order[name.<lang>] combined with a Meilisearch-mapped filter (rarity, set.reference, faction.code, ...) will have Meilisearch reject the sort request; the code catches that and falls back to the (already-fixed) Doctrine path, so results stay correct — just slower until the index is reconfigured.

2. it/es/de are not sortable via Meilisearch. Only name_fr and name_en exist in the Meilisearch index (MeilisearchService::SEARCHABLE_ATTRIBUTES); the other three locales aren't indexed as separate fields at all. The pure-Doctrine path (CardOrderFilter) can already sort by any locale via CardGroupTranslation, but as soon as a request also includes a Meilisearch-mapped filter, only fr/en sort correctly — it/es/de would still be silently ignored. Fixing this fully means adding name_it/name_es/name_de to the Meilisearch document schema, SEARCHABLE_ATTRIBUTES/SORTABLE_ATTRIBUTES, and SearchAwareCollectionProvider::ORDER_MAP — not done here.

Fixes

Altered-Community/community-feedback#75
Altered-Community/community-feedback#64
Altered-Community/community-feedback#50

…i-field priority

Consolidate the three separate order filters (OrderFilter, SetDateOrderFilter,
CardGroupOrderFilter) into a single CardOrderFilter that processes order[...]
params in the order the client sent them, instead of filter-registration order.
Also adds support for order[reference] and order[name.<lang>], previously
silently ignored.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rch path

The Card ordering logic is duplicated across two backends: CardOrderFilter
(pure Doctrine) and SearchAwareCollectionProvider's ORDER_MAP (Meilisearch).
Fixing only the former left the bug in place for any request that also uses
a Meilisearch-mapped filter (rarity, set.reference, faction.code, ...) —
which is most real-world traffic, including the original bug report's own
repro requests.

Add reference/name_fr/name_en to MeilisearchService::SORTABLE_ATTRIBUTES and
to SearchAwareCollectionProvider::ORDER_MAP so Meilisearch can sort/paginate
on these fields too, instead of silently ignoring them.

Note: the live Meilisearch index still needs `app:meilisearch:index --configure`
re-run after deploy to pick up the new sortable attributes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

[Bug] Some sort functions not working [Bug] Sort functionality isn’t working [Bug] Sorting doesn’t work

1 participant