1

Can Searchlogic search with case insensitivity?

Ryan Kohn
  • 13,079
  • 14
  • 56
  • 81
jaycode
  • 2,926
  • 5
  • 35
  • 71

2 Answers2

0

according to searchlogic Read Me

you can use

User.username_like("bjohnson")

and like is case inesnsitive.

Salil
  • 46,566
  • 21
  • 122
  • 156
0

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.

Luke W
  • 8,276
  • 5
  • 44
  • 36