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