OpenLDAP not indexed


OpenLDAP not indexed

Create olcDbIndex live

If you find the following message, in the log file, you should add this to the olcDbIndex.

slapd[2921]: <= bdb_equality_candidates: (uid) not indexed

Basically one of these gets written every time a ldap search is done on a non-indexed attribute. The fix is, like most things with LDAP, completely unintuitive.

Now look at the current configuration:

sudo /usr/sbin/slapcat -n 0 -l config.ldif

Now grep for olcDbIndex (By default only indexing objectClass).

Create a ldif file (indexchanges.ldif) to change the indexing attribute:

dn: olcDatabase={1}hdb,cn=config
changetype: modify
replace: olcDbIndex
olcDbIndex: uid,uidNumber,gidNumber,memberUid,uniqueMember,objectClass,cn eq
sudo ldapmodify -f indexchanges.ldif -D cn=admin,cn=config -x -W