Tag: unaccent

Heroku上的Rails 3.1中的Postgres重音不敏感LIKE搜索

如何在Rails中修改搜索查询的where / like条件: find(:all, :conditions => [“lower(name) LIKE ?”, “%#{search.downcase}%”]) 无论重音如何,结果都匹配? (例如métro= metro)。 因为我使用的是utf8,所以我不能使用“to_ascii”。 生产正在Heroku上运行。