
Search::Z3950::ResultSet - Z39.50 search results

$n = $rs->count;
$rs->prefetch(1, $n) if $n > 0 and $n <= 20;
foreach my $i (1..$n) {
my $rec = $rs->record($i);
if ($rec->isa('MARC::Record')) {
my $title = $rec->title;
my $author = $rec->author;
...
}
...
}

Search::Z3950::ResultSet provides access to the records found in a search using Search::Z3950.

$rs = Search::Z3950::ResultSet->new($zrs);
Construct a new Search::Z3950::ResultSet. The single parameter is the Z39.50 result set (an instance of Net::Z3950::ResultSet).
This method should normally be called only by Search::Z3950.
$n = $rs->count;
The number of matching records.
$rec = $rs->record($i);
Retrieve a matching record. This will be a MARC::Record when possible (i.e., when the underlying object returned by Net::3950::ResultSet isa Net::3950::Record::USMARC); otherwise, it will be an instance of a class in the Net::3950::Record hierarchy.
The single parameter is the record number, which starts at 1 (not zero).
record throws an error if the record couldn't be fetched (e.g., if the server connection has just been lost).
NOTE: the record numbers start at 1.
Did I mention that the record numbers start at 1?
$rs->prefetch($i, $n);
Pre-fetch records $i to $i+$n-1 (inclusive) from the Z39.50 server. Call this method (before calling record) to reduce the number of record requests sent over the network to the server.
(If you're only interested in the first matching record, it probably makes no difference whether you call prefetch or not.)
Returns a true value if the record(s) were successfully retrieved, or a false value otherwise. The retrieved records are not returned.
(As currently implemented, this method simply invokes the present method on the Search::Z3950 object's Net::Z3950 object.)

These methods are for the internal use of Search::Z3950::ResultSet (and its subclasses, if any).
$zrs = $rs->zrs;
$rs->zrs($zrs);
Get or set the Z39.50 result set (an instance of Net::Z3950::ResultSet).

None that I know of. You might check http://rt.cpan.org to see if others have reported any bugs.

prefetch option in Net::Z3950, use prefetch behind the scenes to speed uprecords method to retrieve all records at once? Probably not needed.
Search::Z3950, Net::Z3950::ResultSet, MARC::Record.

Paul Hoffman <nkuitse AT cpan DOT org>

Copyright 2003-2004 Paul M. Hoffman. All rights reserved.
This program is free software; you can redistribute it and modify it under the same terms as Perl itself.