[refinementList]: sortBy does not correctly sort UTF8 chars
See original GitHub issueWhen using the the name
sorting (or keeping the default one), facets starting with an accented character are put at the end.
Instead of the default sorting on strings, we could use localeCompare. It needs to know the user locale, but this is already an information we can pass to the main instance (to specify how to format numbers), so we could re-use it here as well.
It will require a change in the Helper as well I guess.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Refinementlist Sorting Confusion - Algolia Community
Ideally I'd like to use the sortBy parameter to order the categories by their order attribute. Is this not possible or should I...
Read more >How to sort an array of UTF-8 strings? - php - Stack Overflow
You're right - this property is respected by using the correct locale and strcoll() for sorting. The problem here is, that on Windows...
Read more >Instant Meilisearch - npm
When placeholder search is set to false , no results appears when searching on no characters. For example, if the query is ""...
Read more >instantsearch.js - UNPKG
If no refinement value\n * is provided, test if the refinementList contains ... });\n\n return sortBy.reduce(\n function preparePredicate(out, sort) {\n var ...
Read more >Oracle Commerce Guided Search : MDEX Engine Developer's ...
No Dgidx flags are necessary to enable record sorting. If a property or dimension is properly enabled for sorting,.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems there is no way to pass a custom sort function to
sortBy
. What can be done though, is use a normalized string through_.deburr
.Something like
This will convert
Éric
toEric
before applying the sort. Not perfect, but closer to what we want to achieve here.You can use the
sortBy
argument to pass a regular JS sort function to override the sorting behaviour.https://codesandbox.io/s/713rl3zwzq
Sorting can also be done in
transformItems
if you so prefer.