dokuwiki-plugin-struct icon indicating copy to clipboard operation
dokuwiki-plugin-struct copied to clipboard

Sort field columns in aggregations using "natsort" style

Open macneurolab opened this issue 7 years ago • 3 comments

A typical aggregation contains: sort: Field or sort:^Field

It would be very useful to have the option to sort the way php "natsort" does: file1 file2 file10 file20

Currently the result is:

file1 file10 file2 file20

macneurolab avatar Mar 17 '18 13:03 macneurolab

Sorting is done in sqlite, there might be a way to encourage natural sorting though.

splitbrain avatar Jan 10 '19 16:01 splitbrain

How would you encourage natural sorting?

macneurolab avatar Jan 11 '19 01:01 macneurolab

What I meant is that there might be a way to create the SQL query in a way that tells SQLite to use natsort. Unfortunately it seems that SQLite does not have a builtin natsort mechanism. It may be possible to register PHP's natsort as a SQLite callback, but this may have performance penalties. Needs more investigation.

splitbrain avatar Jan 13 '20 12:01 splitbrain