Defect #1608
closedCase-insensitive search
0%
Description
Case-insensitive search doesn't work, but it would be great.
Updated by Jean-Philippe Lang over 16 years ago
- Tracker changed from Patch to Defect
Updated by Jean-Philippe Lang over 16 years ago
Please give redmine, database, ruby, rails... versions as requested in SubmittingBugs.
Case-insensitive search works here:
http://www.redmine.org/search/index/redmine?q=caSe+inSENsitiVe
Updated by Denis Tomashenko over 16 years ago
Jean-Philippe Lang wrote:
Please give redmine, database, ruby, rails... versions as requested in SubmittingBugs.
Sorry...
Redmine 0.7.devel r1643
Apache 2.2.8
MySQL 5.0.51a
Subversion 1.5.0
Ruby 1.8.6
Rails 2.1.0
RubyGems 1.0.1
Updated by Thomas Löber over 16 years ago
What is the character set and collation of your database?
mysql> show variables like 'character_set%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+
mysql> show variables like 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | +----------------------+-----------------+
Updated by Denis Tomashenko over 16 years ago
I sorry again...
MySQL 5.0.45
Variable_name | Value | character_set_client | latin1 | |
character_set_connection | latin1 | |||
character_set_database | latin1 | |||
character_set_filesystem | binary | |||
character_set_results | latin1 | |||
character_set_server | latin1 | |||
character_set_system | utf8 | |||
collation_connection | latin1_swedish_ci | |||
collation_database | latin1_swedish_ci | |||
collation_server | latin1_swedish_ci |
latin1... May be this is a problem?
But all characters in Redmine show correctly.
Updated by Denis Tomashenko over 16 years ago
- Status changed from New to Resolved
After converting data in UTF8 case insensitive search work fine.
But in search results founded words (non latin characters) is not highlighted. For latin characters all ok.
This is a bug?
Updated by Jean-Philippe Lang almost 16 years ago
- Status changed from Resolved to Closed
- Resolution set to Invalid
Please submit a detailled ticket about the last problem you mentionned if needed.
Updated by Dmitry K over 15 years ago
How can i make case insensitive search with redmine installation on windows server?
Updated by Alex A over 13 years ago
I have the same problem for postgresql, and i solve it by patching file search_controller.rb.
I`v add this
like_tokens = @tokens.collect {|w| "%#{Unicode::downcase(w)}%" } r, c = s.singularize.camelcase.constantize.search(like_tokens, projects_to_search,
instead of
r, c = s.singularize.camelcase.constantize.search(@tokes, projects_to_search,
For working you must install gem package unicode (gem install unicode) and add in the top of file search_controller.rb
require 'unicode'
Updated by Ilya Turkin over 10 years ago
Hello,
can i try to reopen it?
I want to admit that the issue contains in version 2.4.6. It can be fixed in lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb by adding mb_chars:
tokens_conditions = [sql, * (tokens.collect {|w| "%#{w.mb_chars.downcase}%"} * token_clauses.size).sort]
Redmine version 2.4.6.stable.13231Ruby version 1.9.2-p290 (2011-07-09) [x86_64-linux]
Rails version 3.2.19
Updated by Toshi MARUYAMA over 10 years ago
Ilya Turkin wrote:
Ruby version 1.9.2-p290 (2011-07-09) [x86_64-linux]
Too old.
Updated by Ilya Turkin over 10 years ago
Hi, Toshi,
ruby version does not matter in the case because String#downcase is working only with ASCII symbols at latest ruby version too:
downcase → new_str Returns a copy of str with all uppercase letters replaced with their lowercase counterparts. The operation is locale insensitive—only characters “A” to “Z” are affected. Note: case replacement is effective only in ASCII region. "hEllO".downcase #=> "hello"
See ruby 2.1 String#downcase if you please.
Updated by Toshi MARUYAMA over 10 years ago
I see. But, case sensitivity depends heavily on Ruby version and DB adapter.
We cannot test on such too old Ruby version.
See http://www.redmine.org/builds/index.html .
Updated by Ilya Turkin over 10 years ago
OK, so if I understand you right when I start to use a shiny new ruby version you will fix it? If it is I move my production to new ruby version next week and come back, OK? :)
Updated by Toshi MARUYAMA over 10 years ago
Ilya Turkin wrote:
OK, so if I understand you right when I start to use a shiny new ruby version you will fix it?
I welcome you to post patch which includes tests for all Redmine support DB and Ruby version.
If it is I move my production to new ruby version next week and come back, OK? :)
Please create new issue.