By default, indexes are sorted alphabetically, in descending ASCII order. This is true for every attribute, even attributes which may have numeric attribute values like Integer or TelephoneNumber. It is possible to change the sort method by changing the matching rule set for the attribute.
13.5.1. Changing the Sort Order in the Console
Select the Configuration tab.
Expand the Data node, expand the suffix of the database to index, and select the database.
Select the Indexes tab in the right pane.
Select the index, and, in the Matching Rules field, enter the new sort order to use. For example, to sort by numbers, rather than alphabetically, enter
13.5.2. Changing the Sort Order in the Command Line
To change the sort order using the command line, change the
nsMatchingRule for the attribute index. For example:
# ldapmodify -D "cn=Directory Manager" -W -x
dn: cn=sn,cn=index,cn=Example1,cn=ldbm database,cn=plugins,cn=config