originally reported at http://drupal.org/node/189278 -- which has moved to a separate issue.

this is a bit of a rat's nest. here's what i've found so far:

  • we're simply using the 'LIKE' operator for our comparisions.
  • mysql (and most other databases, it seems) does case-insensitive text searches by default. so if you're using mysql and having this problem, you'll need to correct that with your database setup.
  • postgres does case-sensitive text searches by default. there are a number of ways make the search case-insensitive, though.

it looks to me like the simplest solution is to use the postgres custom ILIKE operator for these searches, in the case where postgres is the database. we could try using the 'lower' function here in all cases, but i'm not sure of the performance implications, and i'm also not sure it's implementation is consistent across databases.

attached patch uses the ILIKE approach.

CommentFileSizeAuthor
search_case.patch927 byteshunmonk

Comments

dww’s picture

Status: Active » Postponed

I believe we should wait and see what the big kids come up with over at http://drupal.org/node/83738 before we take any action here. There's *a lot* of interest and expertise in the exact same problem, but for core itself, and I think we should stand on the shoulders of giants whenever possible.

That said, one of the options under consideration is a pgsql-specific ILIKE, just like you've got here, so this might end up being the patch we commit, anyway. ;)

Thanks,
-Derek

Kjartan’s picture

Status: Postponed » Closed (won't fix)

In 6.x the search is completely redone, and from what I can tell this isn't an issue any more.

The fix for the similar issue in core was to use ILIKE so the original patch would probably be the proper fix should anyone run into this in 5.x.