in reply to ldap search returns only one entry
You don't say which LDAP module you are using. How is $ldap created?