cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize the number of results from the LDAP?

Former Member
0 Kudos

Hello,

I am using the avax.naming.* package in order to search our LDAP server which is Microsoft Active directory.

The policy of our LDAP server is to return no more than 1000 results for each search request, so when I submit a search query I receive maximum of 1000 results.

Now, we have situations where we need more than 1000 results but we don't want to change our LDAP policy.

Is there a way to set the number of results to be more than 1000?

I tried using this code:

SearchControls controls = new SearchControls();

controls.setCountLimit(0);

But it keeps getting no more than 1000 results.

I also found but it uses the com.sun.jndi.ldap.ctl.* package which, AFAIK, can be used only with SUN LDAP Server and not Microsoft.

Thank you in advance,

Roy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

I will appreciate any information on this issue.

Thanking you in advance,

Maya.

Former Member
0 Kudos

Roy,

Try applying search filters e.g search for a* ,b* ....


try {
IUserFactory userFactory = UMFactory.getUserFactory();
IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();
searchFilter.setFirstName("a*",1,true);
ISearchResult searchResult = userFactory.searchUsers(searchFilter);
		
 while (searchResult.hasNext()) {
       //do something
      }
}

Tegala