"open-ils.storage.biblio.record_entry.retrieve_by_barcode",
$barcode );
- return { ids => $title->id, count => 1 };
+ if($title) {
+ return { ids => $title->id, count => 1 };
+ } else {
+ return { count => 0 };
+ }
+
=head
my $u = OpenILS::Utils::ModsParser->new();
$mods->doc_id($title->id());
return $mods;
=cut
+
}
# grab the mr id's from storage
- my $method = "open-ils.storage.metabib.$class.search_fts.metarecord_count";
- if($self->api_name =~ /staff/) { $method = "$method.staff"; }
+ my $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord_count";
+ if($self->api_name =~ /staff/) {
+ $method = "$method.staff";
+ $method =~ s/\.cachable//o;
+ }
warn "Performing count method $method\n";
warn "API name " . $self->api_name() . "\n";
my $request = $session->request( $method,
term => $string,
org_unit => $org_id,
+ cache_page_size => 1,
depth =>$org_type );
my $count = $request->gather(1);
throw OpenSRF::EX::InvalidArg ("Not a valid search class: $class")
}
- my $method = "open-ils.storage.metabib.$class.search_fts.metarecord.atomic";
+ #my $method = "open-ils.storage.metabib.$class.search_fts.metarecord.atomic";
+ my $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord.atomic";
if($self->api_name =~ /order/) {
- $method = "open-ils.storage.metabib.$class.search_fts.metarecord.unordered.atomic";
+ $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord.unordered.atomic",
+ #$method = "open-ils.storage.metabib.$class.search_fts.metarecord.unordered.atomic";
}
if($self->api_name =~ /staff/) {
$method =~ s/atomic/staff\.atomic/og;
+ $method =~ s/\.cachable//o;
}
warn "Performing search method $method\n";
warn "Search making request " . time() . "\n";
my $request = $session->request(
- #"open-ils.storage.cachable.metabib.$class.search_fts.metarecord.atomic",
$method,
term => $string,
org_unit => $org_id,
depth => $org_type,
limit => $limit,
offset => $offset,
+ cache_page_size => 200,
);
my $records = $request->gather(1);