Skip to content

Add sort by relevance(ES score) and position - #297

Open
Sajgon27 wants to merge 3 commits into
BitBagCommerce:masterfrom
Sajgon27:feature/add-sort-by-relevance-and-position
Open

Add sort by relevance(ES score) and position#297
Sajgon27 wants to merge 3 commits into
BitBagCommerce:masterfrom
Sajgon27:feature/add-sort-by-relevance-and-position

Conversation

@Sajgon27

Copy link
Copy Markdown

Taxon position sorting

  • Restores position as the default sort on taxon product pages (/taxons/{slug}).
  • Added the Position label to the taxon sorting dropdown.

Default search sorting by relevance

  • On /search (shop UI and API), results now default to Elasticsearch relevance (_score) instead of newest-first.
  • Added SearchProductsSortDataHandler (extends the base above); all other sorters delegate to the parent unchanged.
  • Added a Relevance option to the sort dropdown and fixed the sort-label template (it lacked a relevance/position case →
    crashed on select; the default label now reflects the real default sort).
  • API: order_by=relevance added to the OpenAPI order_by enum.
  • Added ui.relevance and ui.position translations.

Tests

  • New phpspec specs for TaxonProductsSortDataHandler and SearchProductsSortDataHandler.
  • Existing phpspec + PHPUnit suites pass (no snapshot regressions).

@Sajgon27
Sajgon27 marked this pull request as ready for review July 22, 2026 08:05
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