This section describes how to index attributes using the dsconfig command-line tool. Indexes are configured per server and index configuration is not replicated.
You can use dsconfig to create local database indexes and Virtual List View (VLV) indexes. A local database index is used to find entries that match search criteria. A VLV index is used to process searches efficiently with VLV controls.
Unindexed searches are denied by default, unless the user has the unindexed-search privilege. For more information, see To Change a Root User's Privileges.
You can determine whether a search is indexed in two ways:
Try to perform the search anonymously. (The server rejects unindexed anonymous searches by default.)
Use the debugsearchindex operational attribute. This attribute provides the indexes used in the search, the number of candidate entries from each index, and the final indexed status. Include the debugsearchindex attribute in your ldapsearch command, as follows:
$ ldapsearch -h localhost -p 1389 -b "dc=example,dc=com" "(objectClass=*)" debugsearchindex