diff --git a/lib/WebGUI/Search.pm b/lib/WebGUI/Search.pm index 15ec45c09..7b0612880 100644 --- a/lib/WebGUI/Search.pm +++ b/lib/WebGUI/Search.pm @@ -262,7 +262,15 @@ sub search { my $query = ""; my @clauses = (); if ($rules->{keywords}) { - push(@params,$rules->{keywords},$rules->{keywords}); + my $keywords = $rules->{keywords}; + unless ($keywords =~ m/"|\*/) { # do wildcards for people, like they'd expect + my @terms = split(' ',$keywords); + for (my $i = 0; $i < scalar(@terms); $i++) { + $terms[$i] .= "*"; + } + $keywords = join(" ", @terms); + } + push(@params, $keywords, $keywords); $self->{_score} = "match (keywords) against (? in boolean mode) as score"; push(@clauses, "match (keywords) against (? in boolean mode)"); } diff --git a/sbin/search.pl b/sbin/search.pl index 68291c016..c9c6306dd 100644 --- a/sbin/search.pl +++ b/sbin/search.pl @@ -101,7 +101,7 @@ sub reindexSite { my $rs = $session->db->read("select assetId, className from asset where state='published'"); while (my ($id, $class) = $rs->array) { my $asset = WebGUI::Asset->new($session,$id,$class); - if (defined $asset && $asset->get("status") eq "approved" || $asset->get("status") eq "archived") { + if (defined $asset && $asset->get("status") eq "approved" || defined $asset && $asset->get("status") eq "archived") { print $asset->getId."\t".$asset->getTitle."\t"; my $t = [Time::HiRes::gettimeofday()]; $asset->indexContent;