smartstore / Smartstore

A modular, scalable and ultra-fast open-source all-in-one eCommerce platform built on ASP.NET Core 7
http://www.smartstore.com/
GNU Affero General Public License v3.0
1.16k stars 427 forks source link

Feature request: Natural sorting for product attributes #1158

Closed stefanmuellerdo closed 4 weeks ago

stefanmuellerdo commented 1 month ago

Feature Request: Natural Sorting for Product Attributes

Summary: Implement natural sorting for product attributes in Smartstore to ensure a more intuitive and user-friendly automatic standard sorting order for alphanumeric strings. without having to set up the sort order manually in the attribute details.

https://en.wikipedia.org/wiki/Natural_sort_order

autosorted

Description: Currently, product attributes in Smartstore are sorted using standard lexicographical order.

This can lead to unintuitive sorting results, especially when dealing with strings containing numbers.

For instance, the current sorting might order "1", "11", "2", which is not ideal for user experience.

Natural sorting would arrange these values as "1", "2", "11", reflecting a more logical numerical progression.

Benefits:

Natural Sorting is standard in modern OS, like MacOS file lists. https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemDetails/FileSystemDetails.html

Has been reported by a store operator & ERP partner.

stefanmuellerdo commented 1 month ago

thanks !!!

mgesing commented 1 month ago

Some notes. NATURAL_SORT_KEY is not supported by T-SQL. Only to be used in certain cases for materialized data. Should be avoided on database side for performance reasons. Link.