--- Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/22 12:57:09 92 +++ Webpacus/lib/Webpacus/Model/WebPAC.pm 2005/11/22 12:57:15 93 @@ -3,8 +3,10 @@ use strict; use warnings; use lib '/data/webpac2/lib'; -use base qw/Catalyst::Model/; -use WebPAC::Search::Estraier; +use base qw/ + Catalyst::Model + WebPAC::Search::Estraier +/; use Data::Dumper; =head1 NAME @@ -42,17 +44,12 @@ my $log = $c->log; -# if (! $c->stash->{est}) { + my $est_cfg = $c->config->{hyperestraier}; + $est_cfg->{'log'} = $log; - my $est_cfg = $c->config->{hyperestraier}; - $est_cfg->{'log'} = $log; + $log->debug("using config:" . Dumper($est_cfg) ); - $log->debug("using config:" . Dumper($est_cfg) ); - -# $c->stash->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } ); -# } - -# $log->debug("param: " . Dumper($c->req->params)); + $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } ); # $c->stash->{est}->search( # query => $c->req->params->{Title}, @@ -63,6 +60,21 @@ } +sub search { + my ( $self, $query ) = @_; + + my @results = $self->{est}->search( + query => $query, + attr => [ '@uri' ], + max => 100, + ); + + return \@results; +} + + + + =head1 AUTHOR Dobrica Pavlinusic