You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
It seems that the search feature is case sensitive. Is there a way to make it NOT case sensitive?
Hello,
I think it can be done in file ./cgi-bin/library/modules/ste_prod.pl
find this line:
$fd_searchstr = $q->param('searchstr');
and add below line:
$fd_searchstr =~ tr/A-Z/a-z/;
-AAJ
Offline
Actuall that fix will just change the search string to lowercase, but will only match lowercase in the DB. If you're using CSV or MySQL, you can do the following:
In the file: ./cgi-bin/library/modules/ste_prod.pl
Where you see the line:
my $searchopr = "LIKE";
at the top of the file, change it to:
my $searchopr = "CLIKE";
This will work for MySQL and CSV, but will blow up on MS SQL Server and PostgreSQL. Be warned...
Offline
>In the file: ./cgi-bin/library/modules/ste_prod.pl
>
>Where you see the line:
>
>my $searchopr = "LIKE";
>
>at the top of the file,
>change it to:
>
>my $searchopr = "CLIKE";
>
>This will work for MySQL and
>CSV, but will blow up
>on MS SQL Server and
>PostgreSQL. Be warned...
Thanks--that worked.
>Actuall that fix will just change
>the search string to lowercase,
>but will only match lowercase
>in the DB.
in simple search in Perl all I need to match everything
without upper/lower case issue is using somewhere:
if ($string =~ /$_/i) {...
the `/i' means 'insensitive' but I didn't hack too deep in actual code to find
where in CCP5 is this place :-)
(anyway with MySQL it will work different way)
Offline
The thing is the search is executed within SQL, not in the context of an array loop. The CLIKE method is the only way I know of within the SQL. If we did a SELECT that returned all the rows and iterated over them in an array the other two methods would work. But who wants all those rows in memory?
Offline