[turba] compound ldap fields and multi-word queries

Ben Poliakoff benp at imap.reed.edu
Mon Dec 15 16:22:15 PST 2003


Hi All,

I benefited greatly from the recent thread about compound ldap fields.
My CVS HEAD Turba/Imp installation is now merrily searching multiple
fields at once.  

I'm faced with another challenge though.  I need to figure out a way to
get Turba to split multi-word (i.e. "Firstname Lastname") search strings
into individual ldap queries instead of the current behavior that I
have (multi-word queries are used as literal strings with spaces...).

This sort of hyperactive query is done by default by apps like Mozilla
Mail and Apple's OSX Addressbook.  While it results in more complicated
ldap queries it also makes it much more likely to find the entry you're
looking for.

Here are some sample ldap queries
(culled from my ldap server's logs) to illustrate what I mean...

Turba's query when I have it search my compound "name" field:

Dec 15 13:11:42 server-1 slapd[2381]: conn=254 op=1 SRCH base="ou=people,dc=reed,dc=edu" scope=2 filter="(&(|(givenName=*ben poliakoff*)(sn=*ben poliakoff*)(cn=*ben poliakoff*)(mail=*ben poliakoff*)))"

OSX Address book query (given the same string):

Dec 15 16:15:43 server-1 slapd[2773]: conn=172 op=1 SRCH base="ou=people,dc=reed,dc=edu" scope=2 filter="(|(|(givenName=ben poliakoff*)(sn=ben poliakoff*)(cn=ben poliakoff*)(mail=ben poliakoff*))(&(|(givenName=ben*)(sn=ben*))(|(givenName=poliakoff*)(sn=poliakoff*))))" 

Mozilla's ldap client code is similar to the OSX example (except that
the search string is given as a "contains", surrounded by asterisks
rather than a "begins with", with an asterisk at the end).

I guess the Mozilla and OSX Addressbook behavior is the result of making
the search query into some sort of array of white space delimited
strings.

Has anyone managed to get this sort of behavior out of Turba?  I
couldn't spot anything of the sort in the mailing list archives, but
then again, I may have missed something.

Thanks!

Ben

-- 
_______________________________________________________________________
Ben Poliakoff                                email: benp at imap.reed.edu
Reed College                                        tel:  503-788-6674
Unix System Administrator                          PGP key: 0x6AF52019
PGP fingerprint:    A131 F813 7A0F C5B7 E74D  C972 9118 A94D 6AF5 2019


More information about the turba mailing list