/[webpac2]/trunk/lib/WebPAC/Search/Estraier.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 /trunk/lib/WebPAC/Search/Estraier.pm

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

revision 122 by dpavlin, Wed Nov 23 21:52:55 2005 UTC revision 152 by dpavlin, Sat Nov 26 01:38:28 2005 UTC
# Line 125  sub search { Line 125  sub search {
125    
126          my $log = $self->_get_logger;          my $log = $self->_get_logger;
127    
128            #$log->debug( 'search args: ' . Dumper($args) );
129    
130          $self->confess('need db in object') unless ($self->{db});          $self->confess('need db in object') unless ($self->{db});
131          $self->confess('need get_attr') unless ($args->{get_attr});          $self->confess('need get_attr') unless ($args->{get_attr});
132    
# Line 132  sub search { Line 134  sub search {
134    
135          my $q = $args->{phrase};          my $q = $args->{phrase};
136    
137            $log->debug("args: " . Dumper( $args ));
138    
139          my $cond = HyperEstraier::Condition->new();          my $cond = HyperEstraier::Condition->new();
140          if ( ref($args->{add_attr}) eq 'ARRAY' ) {          if ( ref($args->{add_attr}) eq 'ARRAY' ) {
141                  $log->debug("adding search attributes: " . join(", ", @{ $args->{add_attr} }) );                  $log->debug("adding search attributes: " . join(", ", @{ $args->{add_attr} }) );
142                  map {                  map {
143                          $cond->add_attr( $self->{iconv}->conver( $_ ) );                          $cond->add_attr( $self->{iconv}->convert( $_ ) );
144                          $log->debug(" + $_");                          $log->debug(" + $_");
145                  } $args->{add_attr};                  } @{ $args->{add_attr} };
146          }          };
147    
148          $cond->set_phrase( $self->{iconv}->convert($q) ) if ($q);          $cond->set_phrase( $self->{iconv}->convert($q) ) if ($q);
149          $cond->set_max( $args->{max} ) if ($args->{max});          $cond->set_max( $args->{max} ) if ($args->{max});

Legend:
Removed from v.122  
changed lines
  Added in v.152

  ViewVC Help
Powered by ViewVC 1.1.26