Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Possible issue when sorting documents lexicographically #333

Closed
Kerollmops opened this issue Aug 31, 2021 · 2 comments · Fixed by #338
Closed

Possible issue when sorting documents lexicographically #333

Kerollmops opened this issue Aug 31, 2021 · 2 comments · Fixed by #338
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Kerollmops
Copy link
Member

We probably found a bug in the sort, asc, desc criterion when we sort on strings, the lexicographic sort feature seems broken and returns documents in an invalid order.

Note that algorithm used to lexicographically sort the documents is, indeed, lexicographic and the sort is based on the UTF-8 bytes of the strings, therefore it could give strange results when the first byte of a wide-character i.e. is lower than the byte of an ascii one i.e. U and is displayed before the ascii one.

You can reproduce the possible bug with the movies.json dataset, by simply sending those settings:

{
    "sortable_attributes": ["title"]
}
@Kerollmops Kerollmops added bug Something isn't working good first issue Good for newcomers labels Aug 31, 2021
@Kerollmops
Copy link
Member Author

Hey @shekhirin, maybe you can look at this issue, it does seem it has been made for you 😄

@shekhirin
Copy link
Contributor

@Kerollmops that's awesome, I'll look into it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants