Lines 160-166
sub FindDuplicate {
Link Here
|
160 |
|
160 |
|
161 |
=head2 SimpleSearch |
161 |
=head2 SimpleSearch |
162 |
|
162 |
|
163 |
( $error, $results, $total_hits ) = SimpleSearch( $query, $offset, $max_results, [@servers] ); |
163 |
( $error, $results, $total_hits ) = SimpleSearch( $query, $offset, $max_results, [@servers], [%options] ); |
164 |
|
164 |
|
165 |
This function provides a simple search API on the bibliographic catalog |
165 |
This function provides a simple search API on the bibliographic catalog |
166 |
|
166 |
|
Lines 172-177
This function provides a simple search API on the bibliographic catalog
Link Here
|
172 |
* @servers is optional. Defaults to biblioserver as found in koha-conf.xml |
172 |
* @servers is optional. Defaults to biblioserver as found in koha-conf.xml |
173 |
* $offset - If present, represents the number of records at the beginning to omit. Defaults to 0 |
173 |
* $offset - If present, represents the number of records at the beginning to omit. Defaults to 0 |
174 |
* $max_results - if present, determines the maximum number of records to fetch. undef is All. defaults to undef. |
174 |
* $max_results - if present, determines the maximum number of records to fetch. undef is All. defaults to undef. |
|
|
175 |
* %options is optional. (e.g. "skip_normalize" allows you to skip changing : to = ) |
175 |
|
176 |
|
176 |
|
177 |
|
177 |
=item C<Return:> |
178 |
=item C<Return:> |
Lines 221-227
$template->param(result=>\@results);
Link Here
|
221 |
=cut |
222 |
=cut |
222 |
|
223 |
|
223 |
sub SimpleSearch { |
224 |
sub SimpleSearch { |
224 |
my ( $query, $offset, $max_results, $servers ) = @_; |
225 |
my ( $query, $offset, $max_results, $servers, %options ) = @_; |
225 |
|
226 |
|
226 |
return ( 'No query entered', undef, undef ) unless $query; |
227 |
return ( 'No query entered', undef, undef ) unless $query; |
227 |
# FIXME hardcoded value. See catalog/search.pl & opac-search.pl too. |
228 |
# FIXME hardcoded value. See catalog/search.pl & opac-search.pl too. |
Lines 243-254
sub SimpleSearch {
Link Here
|
243 |
eval { |
244 |
eval { |
244 |
$zconns[$i] = C4::Context->Zconn( $servers[$i], 1 ); |
245 |
$zconns[$i] = C4::Context->Zconn( $servers[$i], 1 ); |
245 |
if ($QParser) { |
246 |
if ($QParser) { |
246 |
$query =~ s/=/:/g; |
247 |
$query =~ s/=/:/g unless $options{skip_normalize}; |
247 |
$QParser->parse( $query ); |
248 |
$QParser->parse( $query ); |
248 |
$query = $QParser->target_syntax($servers[$i]); |
249 |
$query = $QParser->target_syntax($servers[$i]); |
249 |
$zoom_queries[$i] = new ZOOM::Query::PQF( $query, $zconns[$i]); |
250 |
$zoom_queries[$i] = new ZOOM::Query::PQF( $query, $zconns[$i]); |
250 |
} else { |
251 |
} else { |
251 |
$query =~ s/:/=/g; |
252 |
$query =~ s/:/=/g unless $options{skip_normalize}; |
252 |
$zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]); |
253 |
$zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]); |
253 |
} |
254 |
} |
254 |
$tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] ); |
255 |
$tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] ); |