5 |
use lib '/data/webpac2/lib'; |
use lib '/data/webpac2/lib'; |
6 |
use base qw/ |
use base qw/ |
7 |
Catalyst::Model |
Catalyst::Model |
|
WebPAC::Search::Estraier |
|
8 |
/; |
/; |
9 |
use Data::Dumper; |
use Data::Dumper; |
10 |
use WebPAC::DB; |
use WebPAC::DB; |
11 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
12 |
|
use WebPAC::Search::Estraier 0.02; |
13 |
|
|
14 |
=head1 NAME |
=head1 NAME |
15 |
|
|
107 |
my $template_filename = $template || $self->{template}; |
my $template_filename = $template || $self->{template}; |
108 |
|
|
109 |
my @results = $self->{est}->search( |
my @results = $self->{est}->search( |
110 |
query => $query, |
phrase => $query, |
111 |
attr => [ '@uri' ], |
get_attr => [ '@uri' ], |
112 |
max => 100, |
max => 100, |
113 |
); |
); |
114 |
|
|
120 |
|
|
121 |
my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#); |
my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#); |
122 |
|
|
123 |
# $log->debug("load_ds( $mfn )"); |
#$log->debug("load_ds( $mfn )"); |
124 |
|
|
125 |
my $ds = $self->{db}->load_ds( $mfn ) || next; |
my $ds = $self->{db}->load_ds( $mfn ) || $log->error("can't load_ds( $mfn )") && next; |
126 |
|
|
127 |
|
#$log->debug( "ds = " . Dumper( \@html_results ) ); |
128 |
|
|
129 |
my $html = $self->{out}->apply( |
my $html = $self->{out}->apply( |
130 |
template => $template_filename, |
template => $template_filename, |
131 |
data => $ds, |
data => $ds, |
137 |
|
|
138 |
} |
} |
139 |
|
|
140 |
|
#$log->debug( '@html_results = ' . Dumper( \@html_results ) ); |
141 |
|
|
142 |
return \@html_results; |
return \@html_results; |
143 |
} |
} |
144 |
|
|