sortBy
and relevantSort
widgets.
Set up replicas
Before you implement the search, you need to have replicas for each sorting strategy you want to provide. For more information, see Sort by attribute.Sorting widget
Sort with sortBy
Dropdowns are a familiar widget, common in ecommerce scenarios and power user workflows.
InstantSearch provides sorting dropdowns with the sortBy
widget.
Relevance sort toggle with relevantSort
If you’re using Relevant sort you can use the relevantSort
widget to let users toggle between relevant and regular sorting.
The relevantSort
widget comes with recommended patterns when using Relevant sort, such as displaying the number of sorted results out of the total number of results, and letting users see more results.