/[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 886 by dpavlin, Mon Jun 26 16:39:42 2006 UTC revision 887 by dpavlin, Mon Sep 3 15:26:46 2007 UTC
# Line 5  use strict; Line 5  use strict;
5    
6  use Search::Estraier;  use Search::Estraier;
7  use Encode qw/from_to/;  use Encode qw/from_to/;
8  use Data::Dumper;  use Data::Dump qw/dump/;
9    
10  =head1 NAME  =head1 NAME
11    
# Line 135  sub search { Line 135  sub search {
135    
136          my $log = $self->_get_logger;          my $log = $self->_get_logger;
137    
138          #$log->debug( 'search args: ' . Dumper($args) );          #$log->debug( 'search args: ', dump($args) );
139    
140          $self->confess('need db in object') unless ($self->{db});          $self->confess('need db in object') unless ($self->{db});
141          $self->confess('need get_attr') unless ($args->{get_attr});          $self->confess('need get_attr') unless ($args->{get_attr});
# Line 144  sub search { Line 144  sub search {
144    
145          my $q = $args->{phrase};          my $q = $args->{phrase};
146    
147          $log->debug("args: " . Dumper( $args ));          $log->debug("args: ", dump( $args ));
148    
149          my $cond = Search::Estraier::Condition->new();          my $cond = Search::Estraier::Condition->new();
150          if ( ref($args->{add_attr}) eq 'ARRAY' ) {          if ( ref($args->{add_attr}) eq 'ARRAY' ) {
# Line 169  sub search { Line 169  sub search {
169          $cond->set_max( $page * $max );          $cond->set_max( $page * $max );
170    
171          my $result = $self->{db}->search($cond, ( $args->{depth} || 0 )) ||          my $result = $self->{db}->search($cond, ( $args->{depth} || 0 )) ||
172                  $log->logdie("can't search for ", sub { Dumper( $args ) });                  $log->logdie("can't search for ", sub { dump( $args ) });
173    
174          my $hits = $result->doc_num;          my $hits = $result->doc_num;
175          $log->debug("found $hits hits for '$q'");          $log->debug("found $hits hits for '$q'");
# Line 199  sub search { Line 199  sub search {
199    
200          }          }
201    
202  #       $log->debug("results " . Dumper( \@results ));  #       $log->debug("results " . dump( \@results ));
203    
204          $self->confess("expected to return array") unless (wantarray);          $self->confess("expected to return array") unless (wantarray);
205    

Legend:
Removed from v.886  
changed lines
  Added in v.887

  ViewVC Help
Powered by ViewVC 1.1.26