powered by Jive Software

Case sensitivity in user search

Currently, the user search provided by the search plugin takes the search value provided through ‘‘name’’ as a case sensitive value. This is quite annoying. Searching for the name ‘‘guus’’ should also return users that have set their name as ‘‘Guus’’

The search plugin seems to be limited in its search by the UserProvider interface. It defines two a case sensitive findUsers() methods. Is there a way to make these searches case insensitive?

Most (if not all) DBMSses support the LOWER(string) function. Adjusting the search queries from somthing like

... WHERE name LIKE ''").append(StringUtils.escapeForSQL(query)).append("''");

to

... WHERE LOWER(name) LIKE ''").append(StringUtils.escapeForSQL(query.toLowerCase())).append("''");

could improve functionality for SQL-backed user providers.

Can something similar work for the LDAP provider as well?

For LDAP it depends on the schema that is used. I have a jidUid attribute defined as

attributetype ( 1.3.6.1.4.1.20010.1.1.2.1 NAME ''jidUid''
        DESC ''Jabber User ID (local part of JID)''
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )

so all searches for jidUid are case insensitive by default.