The execution order on setCountLimit and SortControlDirContextProcessor
My Code:
----
SearchControls searchControls = new SearchControls();
searchControls.setSearchScope(SearchControls.SUBTR EE_SCOPE);
searchControls.setCountLimit(1000L);
AggregateDirContextProcessor processor = new AggregateDirContextProcessor() ;
SortControlDirContextProcessor sorter = new SortControlDirContextProcessor("displayName");
processor.addDirContextProcessor(sorter);
List users = ldapTemplate.search(dn, filter.encode(), searchControls, new AttributesMapper() ,processor);
If the the ldap data than 1000, will throw an exception:
----
org.springframework.ldap.SizeLimitExceededExceptio n: [LDAP: error code 4 - This search operation has sent the maximum of 10 entries to the client]; nested exception is javax.naming.SizeLimitExceededException: [LDAP: error code 4 - This search operation has sent the maximum of 10 entries to the client];
Question: If I wish to sort, and then take the first 1000 data, how should I do it?