title: How to paginate in spring ldap using skip value
body: <p>Can any body help me on how I can find some record from LDAP using springldap.</p>
  
  <p>My problem is, I have created a rest service and it accepts some parameter. One is offset and another is limit. Offset parameter escape some record like if my ldap server have 500 record. 
  Now if I give offset value 1 and LIMIT is 100. then it should give first 100 record from ldap.
  If I give offset value 100 and LIMIT is 100, then it should give 100 record after first 100 record from ldap.
  If I give offset value 50 and LIMIT is 10, then it should give 10 record after first 50 record from ldap.</p>
  
  <p>I am stuck on how to set offset value in spring ldap template. I have set limit value and it is working fine. </p>
  
  <p>I am sharing peace of code.</p>
  
  <pre><code>public OrganisationGroups getOrganisationGroup() 
  {
  
      SearchControls controls = new SearchControls();
  
      controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
      controls.setCountLimit(MAXIMUM_SEARCH_GROUP_COUNT);
      AndFilter filter = new AndFilter();
      filter.and(new EqualsFilter("objectclass", "groupOfUniqueNames"));
      List&lt;OrganisationGroup&gt; organisationGroup = ldapTemplate.search("", filter.toString(), controls, new GroupSearchMapper());
  
      OrganisationGroups groups = new OrganisationGroups();
      groups.setOrganisationGroup(organisationGroup);
      groups.setCount(organisationGroup.size());
      return groups;
  }
  </code></pre>
  
  <p>In this code I have set MAXIMUM_SEARCH_GROUP_COUNT variable to find out maximum record from ldap. But I am not able to set parameter or any other way to escape some records from beginning.</p>