diff --git a/lib/WebGUI/Macro/Question_search.pm b/lib/WebGUI/Macro/Question_search.pm index 65728db9f..b1f73b16c 100644 --- a/lib/WebGUI/Macro/Question_search.pm +++ b/lib/WebGUI/Macro/Question_search.pm @@ -22,7 +22,7 @@ sub process { $output = $_[0]; $f = WebGUI::HTMLForm->new(1); $f->hidden("op","search"); - $f->text("keywords",'',$session{form}{keywords}); + $f->text("atLeastOne",'',$session{form}{atLeastOne}); $f->submit(WebGUI::International::get(364)); $temp = $f->print; $output =~ s/\^\?\;/$temp/g; diff --git a/lib/WebGUI/Operation/Search.pm b/lib/WebGUI/Operation/Search.pm index 777b0d48d..5ba1c9a2f 100644 --- a/lib/WebGUI/Operation/Search.pm +++ b/lib/WebGUI/Operation/Search.pm @@ -15,6 +15,7 @@ use strict; use WebGUI::HTMLForm; use WebGUI::International; use WebGUI::Paginator; +use WebGUI::Search; use WebGUI::Session; use WebGUI::SQL; use WebGUI::URL; @@ -24,55 +25,27 @@ our @EXPORT = qw(&www_search); #------------------------------------------------------------------- sub www_search { - my ($f, $p, $output, %page, @keyword, $pageId, $term, %result, $sth, @row, $i); - $f = WebGUI::HTMLForm->new(1); - $f->hidden("op","search"); - $f->text("keywords",'',$session{form}{keywords}); - $f->submit(WebGUI::International::get(364)); - $output = $f->print; - if ($session{form}{keywords} ne "") { - @keyword = split(" ",$session{form}{keywords}); - foreach $term (@keyword) { - $sth = WebGUI::SQL->read("select pageId from page where title like '%".$term."%' and pageId > 25"); - while (($pageId) = $sth->array) { - $result{$pageId} += 5; - } - $sth->finish; - $sth = WebGUI::SQL->read("select pageId from page where metaTags like '%".$term."%' and pageId > 25"); - while (($pageId) = $sth->array) { - $result{$pageId} += 1; - } - $sth->finish; - $sth = WebGUI::SQL->read("select pageId from page where synopsis like '%".$term."%' and pageId > 25"); - while (($pageId) = $sth->array) { - $result{$pageId} += 4; - } - $sth->finish; - $sth = WebGUI::SQL->read("select pageId from wobject where title like '%".$term."%' and pageId > 25"); - while (($pageId) = $sth->array) { - $result{$pageId} += 5; - } - $sth->finish; - $sth = WebGUI::SQL->read("select pageId from wobject where description like '%".$term."%' and pageId > 25"); - while (($pageId) = $sth->array) { - $result{$pageId} += 2; - } - $sth->finish; - foreach $pageId (sort{$result{$a} <=> $result{$b}} keys %result) { - %page = WebGUI::SQL->quickHash("select pageId, title, urlizedTitle from page where pageId=$pageId"); - $row[$i] = '