/[webpac2]/Webpacus/lib/Webpacus/Model/WebPAC.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/lib/Webpacus/Model/WebPAC.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 92 by dpavlin, Tue Nov 22 12:57:09 2005 UTC revision 93 by dpavlin, Tue Nov 22 12:57:15 2005 UTC
# Line 3  package Webpacus::Model::WebPAC; Line 3  package Webpacus::Model::WebPAC;
3  use strict;  use strict;
4  use warnings;  use warnings;
5  use lib '/data/webpac2/lib';  use lib '/data/webpac2/lib';
6  use base qw/Catalyst::Model/;  use base qw/
7  use WebPAC::Search::Estraier;          Catalyst::Model
8            WebPAC::Search::Estraier
9    /;
10  use Data::Dumper;  use Data::Dumper;
11    
12  =head1 NAME  =head1 NAME
# Line 42  sub new { Line 44  sub new {
44    
45          my $log = $c->log;          my $log = $c->log;
46    
47  #       if (! $c->stash->{est}) {          my $est_cfg = $c->config->{hyperestraier};
48            $est_cfg->{'log'} = $log;
49    
50                  my $est_cfg = $c->config->{hyperestraier};          $log->debug("using config:" . Dumper($est_cfg) );
                 $est_cfg->{'log'} = $log;  
51    
52                  $log->debug("using config:" . Dumper($est_cfg) );          $self->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } );
   
 #               $c->stash->{est} = new WebPAC::Search::Estraier( %{ $est_cfg } );  
 #       }  
   
 #       $log->debug("param: " . Dumper($c->req->params));  
53    
54  #       $c->stash->{est}->search(  #       $c->stash->{est}->search(
55  #               query => $c->req->params->{Title},  #               query => $c->req->params->{Title},
# Line 63  sub new { Line 60  sub new {
60    
61  }  }
62    
63    sub search {
64            my ( $self, $query ) = @_;
65    
66            my @results = $self->{est}->search(
67                    query => $query,
68                    attr => [ '@uri' ],
69                    max => 100,
70            );
71    
72            return \@results;
73    }
74    
75    
76            
77    
78  =head1 AUTHOR  =head1 AUTHOR
79    
80  Dobrica Pavlinusic  Dobrica Pavlinusic

Legend:
Removed from v.92  
changed lines
  Added in v.93

  ViewVC Help
Powered by ViewVC 1.1.26