[turba] How do Turba LDAP filters work?

Chuck Hagenbuch chuck at horde.org
Thu Jul 21 19:03:41 PDT 2005


Quoting Kevin Myer <kevin_myer at iu13.org>:

> I'm trying to resolve some performance issues with my LDAP address 
> book lookups.
> I have specified the following filter:
>
> objectclass=person
>
> However, from my LDAP server logs, the filter that is being used is not that
> but:
>
> filter="(|(objectClass=top)(objectClass=person)(objectClass=inetOrgPerson)(objectClass=calEntry)(objectClass=organizationalPerson))"
>
> Those object classes are what are in my objectclass array in my Turba
> sources.php config, so I'm a little confused as to what the purpose of the
> objectclass array is.  It appears to actually be ANDing any filter value I
> specify, with the objectclass array, but then whats the purpose of the filter
> value in sources.php?

To do strict filtering. It looks like your filter isn't getting added 
in at all, so maybe it's not specified right. The objectclass array 
provides a default filter if no other criteria are specified; I'm 
honestly not sure when that was added or if it's right.

> And I'm finding that for all the results returned (approximately 1400 users),
> there is a search occuring against base="uid=uid,ou=people.." for each user.
> This is very inefficient.

Are you saying Turba is doing 1400 searches?

> What should be generated:
>
> SRCH base="ou=People,dc=iu13,dc=k12,dc=pa,dc=us" scope=1
> filter="(objectClass=person)" attrs="dn uid cn mail sn title o postalAddress
> telephoneNumber facsimileTelephoneNumber homePostalAddress homePhone mobile
> description roomNumber ou displayName labeledUri object_pgppublickey calFBURL
> l"
>
> What is happening:
>
> (the equivalent of foreach the_uid):
>
> SRCH base="uid=the_uid, ou=People, dc=iu13, dc=k12, dc=pa, dc=us" scope=0
> filter="(|(objectClass=person))"
> attrs="dn uid cn mail sn title o postalAddress telephoneNumber
> facsimileTelephoneNumber homePostalAddress homePhone mobile description
> roomNumber ou displayName labeledUri object_pgppublickey calFBURL l"
>
> The former is one search, with 1400 results and takes .239s .
>
> The latter is 1400 searches with 1 result per search and takes over 4 
> seconds.

You're going to have to say more about what exactly you're doing, how 
you're using Turba, etc, because that's not how Turba does searches.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the turba mailing list