title: How does ldapsearch sortorder work?
body: <p>With OpenDJ 2.6.0 using the ldapsearch wanted to get sorted data.
  I made several attempts, but the result was always sorted so the same</p>
  
  <h2>Simple sort asc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '+cn' -s sub "objectclass=*" cn
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <h2>Simple sort desc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '-cn' -s sub "objectclass=*" cn
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <h2>Sort with OID asc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '+cn:2.5.13.15' -s sub "objectclass=*"
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <h2>Sort with OID desc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '-cn:2.5.13.15' -s sub "objectclass=*"
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <h2>Sort with name asc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '+cn:integerOrderingMatch' -s sub "objectclass=*"  cn
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <h2>Sort with name desc</h2>
  
  <pre><code>./ldapsearch -b 'ou=people,dc=example,dc=com' -S '-cn:integerOrderingMatch' -s sub "objectclass=*"  cn
  dn: ou=people,dc=example,dc=com
  
  dn: cn=1000000,ou=people,dc=example,dc=com
  cn: 1000000
  
  dn: cn=1000000000001,ou=people,dc=example,dc=com
  cn: 1000000000001
  </code></pre>
  
  <p>Am I doing something wrong or is this error ldapsearch / openDJ?
  Thank you in advance.</p>