--- Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/23 21:52:20 116 +++ Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/27 15:14:54 179 @@ -10,6 +10,8 @@ use WebPAC::DB; use WebPAC::Output::TT; use WebPAC::Search::Estraier 0.02; +use File::Slurp; +use Time::HiRes; =head1 NAME @@ -35,6 +37,7 @@ url: 'http://localhost:1978/node/webpac2' user: 'admin' passwd: 'admin' + hits_on_page: 100 webpac: db_path: '/data/webpac2/db' @@ -59,12 +62,20 @@ my $est_cfg = $c->config->{hyperestraier}; $est_cfg->{'log'} = $log; + $est_cfg->{encoding} = $est_cfg->{catalyst_encoding}; + $log->debug("using config:" . Dumper($est_cfg) ); $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } ); - my $db_path = $c->config->{webpac}->{db_path}; - my $template_path = $c->config->{webpac}->{template_path}; + # save config parametars in object + foreach my $f (qw/db_path template_path hits_on_page webpac_encoding out_encoding/) { + $self->{$f} = $c->config->{hyperestraier}->{$f} || + $c->config->{webpac}->{$f}; + $log->debug("self->{$f} = " . $self->{$f}); + } + my $db_path = $self->{db_path}; + my $template_path = $self->{template_path}; $log->debug("using db path '$db_path', template path '$template_path'"); @@ -93,26 +104,72 @@ "'" ); + return $self; } + +=head2 search + + my $m->search( + phrase => 'query phrase', + add_attr => \@add_attr + get_attr => [ '@uri' ], + max => 42, + template => 'result_template.tt', + ); + +All fields are standard C parametars except +C