--- loncom/interface/lonsearchcat.pm 2003/06/06 02:24:49 1.176
+++ loncom/interface/lonsearchcat.pm 2003/06/16 19:42:02 1.179
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.176 2003/06/06 02:24:49 www Exp $
+# $Id: lonsearchcat.pm,v 1.179 2003/06/16 19:42:02 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -214,8 +214,7 @@ sub handler {
## Initialize global variables
##
my $domain = $r->dir_config('lonDefDomain');
- $diropendb= "/home/httpd/perl/tmp/".&Apache::lonnet::escape($domain).
- "\_".&Apache::lonnet::escape($ENV{'user.name'})."_searchcat.db";
+ $diropendb= "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_searchcat.db";
#
# set the name of the persistent database
# $ENV{'form.persistent_db_id'} can only have digits in it.
@@ -1499,13 +1498,13 @@ sub parse_basic_search {
}
# Build SQL query string based on form page
my $query='';
- my $concatarg=join('," ",',
+ my $concatarg=join(',',
('title', 'author', 'subject', 'notes', 'abstract',
'keywords'));
$concatarg='title' if $ENV{'form.titleonly'};
- $query=&build_SQL_query('concat('.$concatarg.')',$search_string);
+ $query=&build_SQL_query('concat_ws(" ",'.$concatarg.')',$search_string);
$pretty_search_string .= "
\n";
- return 'select * from metadata where '.$query,$pretty_search_string;
+ return 'SELECT * FROM metadata WHERE '.$query,$pretty_search_string;
}
@@ -1622,9 +1621,9 @@ sub recursive_SQL_query_build {
my ($key,$value)=($1,$2);
my $replacement='';
if ($key eq 'literal') {
- $replacement="($dkey like \"\%$value\%\")";
- } elsif ($key eq 'not') {
- $value=~s/like/not like/;
+ $replacement="($dkey LIKE \"\%$value\%\")";
+ } elsif (lc($key) eq 'not') {
+ $value=~s/LIKE/NOT LIKE/;
# $replacement="($dkey not like $value)";
$replacement="$value";
} elsif ($key eq 'and') {
@@ -2131,6 +2130,7 @@ END
my $time_remaining = $max_time - (time - $starttime) ;
my $last_time = $time_remaining;
&update_seconds($r,$time_remaining);
+ &update_status($r,'contacting '.$Servers_to_contact[0]);
while (($time_remaining > 0) &&
((@Servers_to_contact) || keys(%Server_status))) {
# Send out a search request if it needs to be done.
@@ -2369,7 +2369,7 @@ sub display_results {
."\n"
);
if ($total_results == 0) {
- $r->print("There are currently no results.\n".
+ $r->print("