Closed bart3r closed 8 years ago
That is, explicitly configure the plugin as regards case sensitivity? In your opinion what should be the default?
I certainly believe that the default should be case-insensitive matching as this is much more popular, but there should be a config option to change it.
But by default it should use an UPPER compare, as this works on 99% of databases.
So, in /lib/wice/columns/column_string.rb line 82, change it to something like this:
[ " #{negation} UPPER(#{@column_wrapper.alias_or_table_name(table_alias)}.#{@column_wrapper.name}) #{::Wice.get_string_matching_operators(@column_wrapper.model)} ?", '%' + string_fragment.upcase + '%' ]
Can you change this, or would you like a Pull Request?
I would not make this the default option, in my branch I added support for a separate option CI_LIKE
which is translated to using a normal like and uppercase both sides. See: https://github.com/nathanvda/wice_grid/commit/182eb20bcf34d37b42ee67481bc052da75c72156
Yuri,
Will you add support for this feature in your next release?
@bart3r I plan to merge @nathanvda 's changes
This didn't seem to make the last release. When will you merge it in ?
Added in 3.6.0.pre4
https://github.com/leikind/wice_grid/wiki/What's-New-In-3.6.0
There really isn't good support for case-insensitive matching, especially for people not using Postgres. I've seen the config for STRING_MATCHING_OPERATOR, but we use an Oracle database and the ILIKE function isn't available, so there is no solution.
Could you not enhance the matching code to include the ability to do an UPPER (or LOWER) comparison on the string? This would be a big improvement and provide a solution for nearly any database.