--- Webpacus/lib/Webpacus/Model/WebPAC.pm 2006/01/22 02:52:24 382 +++ Webpacus/lib/Webpacus/Model/WebPAC.pm 2006/01/22 02:52:29 383 @@ -169,13 +169,6 @@ my $query = $args->{phrase} || $log->warn("no query phrase") && return; - $log->debug("search model query: '$query'"); - if ($args->{add_attr}) { - $log->debug(" + add_attr: " . - join("','", @{ $args->{add_attr} }) - ); - } - my $template_filename = $args->{template} || $self->{template}; $args->{max} ||= $self->{'hits_for_pager'}; @@ -194,8 +187,9 @@ $args->{depth} = $default; $log->warn("using default search depth $default"); } + $args->{depth} ||= 0; - $log->debug("searching for maximum $args->{max} results using depth $args->{depth}"); + $log->debug("searching for maximum $args->{max} results using depth $args->{depth} phrase: ", $query || '[none]'); # # construct condition for Hyper Estraier @@ -204,7 +198,7 @@ if ( ref($args->{add_attr}) eq 'ARRAY' ) { $log->debug("adding search attributes: " . join(", ", @{ $args->{add_attr} }) ); map { - $cond->add_attr( _convert( $_ ) ); + $cond->add_attr( $_ ); $log->debug(" + $_"); } @{ $args->{add_attr} }; }; @@ -224,7 +218,7 @@ $cond->set_max( $page * $max ); - my $result = $self->{est_node}->search($cond, ( $args->{depth} || 0 )); + my $result = $self->{est_node}->search($cond, $args->{depth}); my $hits = $result->doc_num; $log->debug( sprintf("search took %.6fs and returned $hits hits.", $times->{est}) ); @@ -306,7 +300,7 @@ } - $log->debug( '@results = ' . Dumper( \@results ) ); + #$log->debug( '@results = ' . Dumper( \@results ) ); $log->debug( sprintf( "duration breakdown: estraier %.6fs, hash %.6fs, store %.6fs, apply %.6fs, decode %.06f, total: %.6fs", @@ -555,14 +549,14 @@ my $s; if ($s_el > 0) { - $s = $item->{'search'}->[$i] || die "can't find value $i for type search in field $search"; + $s = $item->{'search'}->[$i] or warn "can't find value $i for type search in field $search"; } else { $s = $item->{'search'}->[0]; } #$s =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg; $s = __quotemeta( $s ); - my $d = $item->{'display'}->[$i] || die "can't find value $i for type display in field $display"; + my $d = $item->{'display'}->[$i] or warn "can't find value $i for type display in field $display"; my $template_arg = ''; $template_arg = qq{,'$template'} if ($template);