Searchlogic可以不区分大小写地进行搜索吗?
according to searchlogic Read Me
you can use
User.username_like("bjohnson")
and like is case inesnsitive
.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.