views:

31

answers:

2

Hi,

Can Searchlogic search with case insensitivity?

Thanks,

Jay

A: 

according to searchlogic Read Me

you can use

User.username_like("bjohnson")

and like is case inesnsitive.

Salil
A: 

Depends on your database configuration. For instance, postgres is case-sensitive by default and

User.username_like("bjohnson")

would not find Bjohnson.

sqlite is case-insensitive by default and would find Bjohnson, however.

Later versions of binarylogic's searchlogic has postgres-specific code that uses ILIKE to perform case-insensitive searches.

Any custom named scopes that you create will of course need to consider your db platform when case-sensitivity is a concern.

lukewendling