--- Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/25 01:24:31 143 +++ Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/30 23:21:30 200 @@ -8,9 +8,10 @@ /; use Data::Dumper; use WebPAC::DB; -use WebPAC::Output::TT; +use WebPAC::Output::TT 0.02; use WebPAC::Search::Estraier 0.02; use File::Slurp; +use Time::HiRes; =head1 NAME @@ -67,9 +68,14 @@ $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } ); - my $db_path = $c->config->{webpac}->{db_path}; - my $template_path = $c->config->{webpac}->{template_path}; - $self->{template_path} = $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'"); @@ -98,53 +104,72 @@ "'" ); + return $self; } -=head2 iconv_on_save - my $out = $m->iconv_on_save( $content ); +=head2 search -Convert data saved to disk in Webpac encoding. + 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