Issue
How can I limit the number of result records returned from Mirapoint directory server when I complete a search?
Solution
The number of results records returned from a Mirapoint directory server can be limited by configuring the sizelimit parameter of the directory server.
For example:
Add a database with two entries by completing the following steps. If you search the database with no 'sizelimit' attribute set; the directory server returns all the records matching the criteria. Set its value to one; and the directory server returns a single record.
1.Adding a database at CLI with two entries:
vm201> dir adddb miratop
vm201> dir adddbsuffix miratop o=miratop
vm201> dir importldif o=miratop "c"
Enter LDIF directory data, ending with '.':
dn: o=miratop
objectclass: Organization
o: miratop
dn: ou=domains,o=miratop
objectclass: OrganizationalUnit
ou: domains
.
INFO "adding data"
INFO "2 of 2 successful"
OK Completed
2.Displaying all entries present in the directory:
If you do not set the size limit the directory server returns all the entries matching the criteria:
vm201> ldapsearch ldap://127.0.0.1:389 o=miratop "(objectclass=*)"Â Â Â Â Â Â
"dn: o=miratop"
"objectClass: Organization"
"o: miratop"
"dn: ou=domains,o=miratop"
"objectClass: OrganizationalUnit"
"ou: domains"
OK Completed
3.Set databases' sizelimit parameter to 1 by entering the following command:
Enter the following command to set the sizelimit to 1. The directory server returns a single record.
vm201> dir setdboption miratop sizelimit 1
4. Display all objectclasses present in the database with one record returned:
As "sizelimit" is now set to 1, a single entry is returned by the directory server. When the attribute was not set, directory server returned all the entries available in the database.
vm201> ldap search ldap://127.0.0.1:389 o=miratop "(objectclass=*)"
"dn: o=miratop"
"objectClass: Organization"
"o: miratop"
NO Size limit exceeded
The default value of the parameter is 100. "size limit" can be beneficial if an administrator wants to export more then 100 entries from the directory server, e.g. 1000Â entries at a time.
Other database parameters that may be configured are displayed by the "help dir setdboption" command. Please see the CLI help or the Protocol Reference Guide for more information.
Comments
0 comments
Please sign in to leave a comment.