Lines 88-105
if ( $op eq "do_search" ) {
Link Here
|
88 |
my $resultsperpage = $query->param('resultsperpage') || 20; |
88 |
my $resultsperpage = $query->param('resultsperpage') || 20; |
89 |
my $offset = ( $startfrom - 1 ) * $resultsperpage + 1; |
89 |
my $offset = ( $startfrom - 1 ) * $resultsperpage + 1; |
90 |
|
90 |
|
91 |
my $builder = Koha::SearchEngine::QueryBuilder->new( |
|
|
92 |
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); |
93 |
my $searcher = Koha::SearchEngine::Search->new( |
94 |
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); |
95 |
my $search_query = $builder->build_authorities_query_compat( |
96 |
[$marclist], [$and_or], [$excluding], [$operator], |
97 |
[$value], $authtypecode, $orderby |
98 |
); |
99 |
my ( $results, $total ) = $searcher->search_auth_compat( |
100 |
$search_query, $offset, $resultsperpage |
101 |
); |
102 |
|
103 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
91 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
104 |
{ |
92 |
{ |
105 |
template_name => "authorities/searchresultlist.tt", |
93 |
template_name => "authorities/searchresultlist.tt", |
Lines 109-114
if ( $op eq "do_search" ) {
Link Here
|
109 |
} |
97 |
} |
110 |
); |
98 |
); |
111 |
|
99 |
|
|
|
100 |
my $builder = Koha::SearchEngine::QueryBuilder->new( |
101 |
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); |
102 |
my $searcher = Koha::SearchEngine::Search->new( |
103 |
{ index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); |
104 |
|
105 |
my $search_query = $builder->build_authorities_query_compat( |
106 |
[$marclist], [$and_or], [$excluding], [$operator], |
107 |
[$value], $authtypecode, $orderby |
108 |
); |
109 |
my ( $results, $total ); |
110 |
eval { |
111 |
( $results, $total ) = $searcher->search_auth_compat( |
112 |
$search_query, $offset, $resultsperpage |
113 |
); |
114 |
}; |
115 |
if ($@) { |
116 |
my $query_error = q{}; |
117 |
$query_error .= $@ if $@; |
118 |
$template->param(query_error => $query_error); |
119 |
} |
120 |
|
112 |
$template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate'); |
121 |
$template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate'); |
113 |
$template->param( |
122 |
$template->param( |
114 |
csrf_token => Koha::Token->new->generate_csrf({ |
123 |
csrf_token => Koha::Token->new->generate_csrf({ |