On Fri, 2010-10-29 at 10:18 +0200, RL wrote: > Executing a query and sorting by this field leads to unnatural sorting of : > string1 > string10 > string2
That's very much natural. Numbers are not treated any different from words made up of letters. Your have to use alignment if you want to use natural sorting: string01 string02 string10 > (Some time ago i used Lucene and i was pretty sure that Lucene used a > natural sort, thus i expected the same from solr) Lucene sorts the same way, if you just use standard sort. > Is there a way to sort in a natural order? Config option? Plugin? Expected > output would be: > string1 > string2 > string10 I don't know how to do this in Solr, sorry. To do it in Lucene without changing the terms, you could use a custom comparator that tokenizes the Strings in numbers vs. everything else and do the compare token-by-token, alternating between natural sort and numeric sort depending on the token type.